home *** CD-ROM | disk | FTP | other *** search
/ Languguage OS 2 / Languguage OS II Version 10-94 (Knowledge Media)(1994).ISO / gnu / amiga / gcc222df.lha / gcc-2.2.2-diff < prev   
Text File  |  1992-07-18  |  75KB  |  2,407 lines

  1. diff -2rcN gcc-2.2.2/Makefile.in my-gcc-2.2.2/Makefile.in
  2. *** gcc-2.2.2/Makefile.in    Sun Jun 14 21:40:34 1992
  3. --- my-gcc-2.2.2/Makefile.in    Sat Jul 18 01:23:22 1992
  4. ***************
  5. *** 385,389 ****
  6.       _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
  7.       _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
  8. !     _varargs _eprintf _builtin_new _builtin_New _builtin_del \
  9.       _bb _shtab _clear_cache _trampoline __main _exit
  10.   
  11. --- 385,389 ----
  12.       _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf \
  13.       _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi \
  14. !     _varargs _eprintf _builtin_new _caps_New _builtin_del \
  15.       _bb _shtab _clear_cache _trampoline __main _exit
  16.   
  17. diff -2rcN gcc-2.2.2/c-parse.y my-gcc-2.2.2/c-parse.y
  18. *** gcc-2.2.2/c-parse.y    Wed Jun 10 04:25:30 1992
  19. --- my-gcc-2.2.2/c-parse.y    Fri Jul 17 22:37:53 1992
  20. ***************
  21. *** 779,783 ****
  22.   attrib
  23.       : IDENTIFIER
  24. !     { if (strcmp (IDENTIFIER_POINTER ($1), "packed"))
  25.           warning ("`%s' attribute directive ignored",
  26.                IDENTIFIER_POINTER ($1));
  27. --- 779,790 ----
  28.   attrib
  29.       : IDENTIFIER
  30. !     {
  31. ! #ifdef HANDLE_ATTRIBUTE0
  32. !       /* give the function a chance to validate further attributes */
  33. !       if (HANDLE_ATTRIBUTE0 (IDENTIFIER_POINTER ($1)) ||
  34. !           strcmp (IDENTIFIER_POINTER ($1), "packed"))
  35. ! #else
  36. !       if (strcmp (IDENTIFIER_POINTER ($1), "packed"))
  37. ! #endif
  38.           warning ("`%s' attribute directive ignored",
  39.                IDENTIFIER_POINTER ($1));
  40. diff -2rcN gcc-2.2.2/cccp.c my-gcc-2.2.2/cccp.c
  41. *** gcc-2.2.2/cccp.c    Sat Jun  6 21:46:01 1992
  42. --- my-gcc-2.2.2/cccp.c    Fri Jul 17 22:38:01 1992
  43. ***************
  44. *** 40,43 ****
  45. --- 40,57 ----
  46.   #endif /* not EMACS */
  47.   
  48. + #ifdef amigados
  49. + /* since cpp uses alloca to store all its read files, this is quite deadly
  50. +    on a system with non-automatic stackgrowth like amigados, so we better
  51. +    turn it off now..
  52. +    Note that it's not wise to generally inhibit __builtin_alloca, since
  53. +    using the generic emulator entitels a serious (!) speed penalty, and
  54. +    it's bad enough that we have to live with it in cccp, don't make cc1
  55. +    unbearably slow as well... */
  56. + #undef alloca
  57. + static int amigados_abs_file ();
  58. + #endif
  59.   #ifndef STANDARD_INCLUDE_DIR
  60.   #define STANDARD_INCLUDE_DIR "/usr/include"
  61. ***************
  62. *** 137,141 ****
  63. --- 151,159 ----
  64.   extern struct tm *localtime ();
  65.   extern int sys_nerr;
  66. + #ifndef HAVE_STRERROR
  67.   extern char *sys_errlist[];
  68. + #define strerror(err) sys_errlist[err]
  69. + #endif
  70.   
  71.   #ifndef errno
  72. ***************
  73. *** 1683,1686 ****
  74. --- 1701,1707 ----
  75.         char *p1 = p;
  76.         /* Discard all directory prefixes from P.  */
  77. + #ifdef FILE_NAME_NONDIRECTORY
  78. +       p = FILE_NAME_NONDIRECTORY (p);
  79. + #else
  80.         while (*p1) {
  81.       if (*p1 == '/')
  82. ***************
  83. *** 1688,1691 ****
  84. --- 1709,1713 ----
  85.       p1++;
  86.         }
  87. + #endif
  88.         /* Output P, but remove known suffixes.  */
  89.         len = strlen (p);
  90. ***************
  91. *** 3399,3403 ****
  92.         if (!no_output && already_output == 0
  93.         && (kt->pass_thru
  94. !           || (kt->type == T_DEFINE
  95.             && (dump_macros == dump_names
  96.                 || dump_macros == dump_definitions)))) {
  97. --- 3421,3425 ----
  98.         if (!no_output && already_output == 0
  99.         && (kt->pass_thru
  100. !           || ((kt->type == T_DEFINE || kt->type == T_UNDEF)
  101.             && (dump_macros == dump_names
  102.                 || dump_macros == dump_definitions)))) {
  103. ***************
  104. *** 3702,3705 ****
  105. --- 3724,3739 ----
  106.   #ifndef VMS
  107.           ep = rindex (nam, '/');
  108. + #ifdef amigados
  109. +         /* amigados uses unix-style directory-filename separation, but
  110. +            has VMS-style logicals as well */
  111. +         if (ep == NULL) 
  112. +           {
  113. +         ep = rindex (nam, ':');
  114. +         /* a ':' is part of the directory name, a '/' isn't ! */
  115. +             if (ep != NULL) ep++;
  116. +           }
  117. + #endif /* amigados */
  118.   #else                /* VMS */
  119.           ep = rindex (nam, ']');
  120. ***************
  121. *** 3777,3781 ****
  122. --- 3811,3819 ----
  123.     /* If specified file name is absolute, just open it.  */
  124.   
  125. + #ifndef amigados
  126.     if (*fbeg == '/') {
  127. + #else
  128. +   if (amigados_abs_filename (fbeg, flen)) {
  129. + #endif
  130.       strncpy (fname, fbeg, flen);
  131.       fname[flen] = 0;
  132. ***************
  133. *** 3800,3803 ****
  134. --- 3838,3845 ----
  135.         continue;
  136.       strcpy (fname, searchptr->fname);
  137. + #ifdef amigados
  138. +     if (fname[strlen (fname) - 1] != ':')
  139. + #endif
  140.       strcat (fname, "/");
  141.       fname[strlen (fname) + flen] = 0;
  142. ***************
  143. *** 7544,7548 ****
  144.   
  145.     if (errno < sys_nerr)
  146. !     fprintf (stderr, "%s: %s\n", name, sys_errlist[errno]);
  147.     else
  148.       fprintf (stderr, "%s: undocumented I/O error\n", name);
  149. --- 7586,7590 ----
  150.   
  151.     if (errno < sys_nerr)
  152. !     fprintf (stderr, "%s: %s\n", name, strerror (errno));
  153.     else
  154.       fprintf (stderr, "%s: undocumented I/O error\n", name);
  155. ***************
  156. *** 8441,8447 ****
  157.        char *name;
  158.   {
  159.     fprintf (stderr, "%s: ", progname);
  160. !   if (errno < sys_nerr)
  161. !     fprintf (stderr, "%s: %s\n", name, sys_errlist[errno]);
  162.     else
  163.       fprintf (stderr, "%s: undocumented I/O error\n", name);
  164. --- 8483,8491 ----
  165.        char *name;
  166.   {
  167. +   int error = errno;
  168.     fprintf (stderr, "%s: ", progname);
  169. !   if (error < sys_nerr)
  170. !     fprintf (stderr, "%s: %s\n", name, strerror (error));
  171.     else
  172.       fprintf (stderr, "%s: undocumented I/O error\n", name);
  173. ***************
  174. *** 8800,8801 ****
  175. --- 8844,8869 ----
  176.   
  177.   #endif /* VMS */
  178. + #ifdef amigados
  179. + /* This function returns whether the LEN characters long filename FNAME 
  180. +    is an absolute path specification. */
  181. + static int
  182. + amigados_abs_filename (fname, len)
  183. +      char *fname;
  184. +      int len;
  185. + {
  186. +   /* we're using ixemul.library, which treats `/foo' as `foo:', so 
  187. +      fname[0] is to be considered absolute as well */
  188. +   if (fname[0] == '/')
  189. +     return 1;
  190. +   /* else do an index() on fname, but one which is limited to len characters */
  191. +   while (*fname && *fname != ':' && len) 
  192. +     fname++, len--;
  193. +   return *fname == ':';
  194. + }
  195. + #endif /* amigados */
  196. diff -2rcN gcc-2.2.2/config/amigados.c my-gcc-2.2.2/config/amigados.c
  197. *** gcc-2.2.2/config/amigados.c
  198. --- my-gcc-2.2.2/config/amigados.c    Fri Jul 17 22:38:03 1992
  199. ***************
  200. *** 0 ****
  201. --- 1,158 ----
  202. + /* Definitions of target machine for GNU compiler.  amiga 68000/68020 version.
  203. +    Copyright (C) 1992 Free Software Foundation, Inc.
  204. +    Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
  205. + This file is part of GNU CC.
  206. + GNU CC is free software; you can redistribute it and/or modify
  207. + it under the terms of the GNU General Public License as published by
  208. + the Free Software Foundation; either version 2, or (at your option)
  209. + any later version.
  210. + GNU CC is distributed in the hope that it will be useful,
  211. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  212. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  213. + GNU General Public License for more details.
  214. + You should have received a copy of the GNU General Public License
  215. + along with GNU CC; see the file COPYING.  If not, write to
  216. + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  217. + #include "m68k.c"
  218. + /* Does operand (which is a symbolic_operand) live in text space? If
  219. +    so SYMBOL_REF_FLAG, which is set by ENCODE_SECTION_INFO, will be true.
  220. +    This function is used in base relative code generation. */
  221. + int
  222. + read_only_operand (operand)
  223. +      rtx operand;
  224. + {
  225. +   if (GET_CODE (operand) == CONST)
  226. +     operand = XEXP (XEXP (operand, 0), 0);
  227. +   if (GET_CODE (operand) == SYMBOL_REF)
  228. +     return SYMBOL_REF_FLAG (operand) || CONSTANT_POOL_ADDRESS_P (operand);
  229. +   return 1;
  230. + }
  231. + /* the rest of the file is to implement AmigaDOS specific keywords some day.
  232. +    The approach used so far used __attribute__ for this, but this required
  233. +    changes to c-parse.y as well as if we'd use the common keywords used
  234. +    on commercial AmigaDOS C-compilers as well. So in the future I'll probably
  235. +    switch to __saveds and __interrupt keywords as well.
  236. +    The rest of this file is currently ignored, because it's no longer
  237. +    working with the current gcc version. */
  238. + #if not_yet_working
  239. + #include "tree.h"
  240. + struct attribute {
  241. +   tree ident;
  242. +   int  saveds : 1,
  243. +        interrupt : 1;
  244. + };
  245. + static struct attribute *a_tab = 0;
  246. + static int a_index, a_size;
  247. + void
  248. + add_attr_entry (attr)
  249. +     struct attribute *attr;
  250. + {
  251. +   if (! a_tab)
  252. +     {
  253. +       a_size = 10;
  254. +       a_index = 0;
  255. +       a_tab  = (struct attribute *) xmalloc (a_size * sizeof (struct attribute));
  256. +     }
  257. +   if (a_index == a_size)
  258. +     {
  259. +       a_size <<= 1;
  260. +       a_tab = (struct attribute *) xrealloc (a_tab, a_size * sizeof (struct attribute));
  261. +     }
  262. +   a_tab[a_index++] = *attr;
  263. + }
  264. + void
  265. + attr_do_saveds (function_ident)
  266. +       tree function_ident;
  267. + {
  268. +   struct attribute attr, *a;
  269. +   int i;
  270. +   for (i = 0, a = a_tab; i < a_index; i++, a++)
  271. +     if (a->ident == function_ident)
  272. +       {
  273. +     a->saveds = 1;
  274. +     return;
  275. +       }
  276. +   /* create a new entry for this function */
  277. +   attr.ident     = function_ident;
  278. +   attr.saveds    = 1;
  279. +   attr.interrupt = 0;
  280. +   add_attr_entry (&attr);
  281. + }
  282. + void
  283. + attr_do_interrupt (function_ident)
  284. +     tree function_ident;
  285. + {
  286. +   struct attribute attr, *a;
  287. +   int i;
  288. +   for (i = 0, a = a_tab; i < a_index; i++, a++)
  289. +     if (a->ident == function_ident)
  290. +       {
  291. +     /* __interrupt implies __saveds */
  292. +     a->saveds    = 1;
  293. +     a->interrupt = 1;
  294. +     return;
  295. +       }
  296. +   /* create a new entry for this function */
  297. +   attr.ident     = function_ident;
  298. +   attr.saveds     = 1;
  299. +   attr.interrupt = 1;
  300. +   add_attr_entry (&attr);
  301. + }
  302. + int
  303. + attr_does_saveds (function_name)
  304. +     char *function_name;
  305. + {
  306. +   tree ident = get_identifier (function_name);
  307. +   struct attribute *attr;
  308. +   int i;
  309. +   
  310. +   for (i = 0, attr = a_tab; i < a_index; i++, attr++)
  311. +     if (attr->ident == ident)
  312. +       return attr->saveds;
  313. +   return 0;
  314. + }
  315. + int
  316. + attr_does_interrupt (function_name)
  317. +     char *function_name;
  318. + {
  319. +   tree ident = get_identifier (function_name);
  320. +   struct attribute *attr;
  321. +   int i;
  322. +   
  323. +   for (i = 0, attr = a_tab; i < a_index; i++, attr++)
  324. +     if (attr->ident == ident)
  325. +       return attr->interrupt;
  326. +   return 0;
  327. + }
  328. + #endif
  329. diff -2rcN gcc-2.2.2/config/amigados.h my-gcc-2.2.2/config/amigados.h
  330. *** gcc-2.2.2/config/amigados.h
  331. --- my-gcc-2.2.2/config/amigados.h    Fri Jul 17 22:38:05 1992
  332. ***************
  333. *** 0 ****
  334. --- 1,377 ----
  335. + /* Definitions of target machine for GNU compiler.  amiga 68000/68020 version.
  336. +    Copyright (C) 1992 Free Software Foundation, Inc.
  337. +    Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
  338. + This file is part of GNU CC.
  339. + GNU CC is free software; you can redistribute it and/or modify
  340. + it under the terms of the GNU General Public License as published by
  341. + the Free Software Foundation; either version 2, or (at your option)
  342. + any later version.
  343. + GNU CC is distributed in the hope that it will be useful,
  344. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  345. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  346. + GNU General Public License for more details.
  347. + You should have received a copy of the GNU General Public License
  348. + along with GNU CC; see the file COPYING.  If not, write to
  349. + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  350. + #include "m68k.h"
  351. + /* See tm-m68k.h.  0 means 68000 without 68881.  */
  352. + #ifndef TARGET_DEFAULT
  353. + #define TARGET_DEFAULT 0
  354. + #endif
  355. + /* Define __HAVE_68881__ in preprocessor according to the -m flags.
  356. +    This will control the use of inline 68881 insns in certain macros.
  357. +    Also inform the program which CPU this is for.  */
  358. + #if TARGET_DEFAULT & 02
  359. + /* -m68881 is the default */
  360. + #define CPP_SPEC \
  361. + "%{!msoft-float:-D__HAVE_68881__ }\
  362. + %{!ansi:%{m68000:-Dmc68010}%{mc68000:-Dmc68010}%{!mc68000:%{!m68000:-Dmc68020}}}"
  363. + #else
  364. + /* -msoft-float is the default, assume -mc68000 as well */
  365. + #define CPP_SPEC \
  366. + "%{m68881:-D__HAVE_68881__ }\
  367. + %{!ansi:%{m68020:-Dmc68020}%{mc68020:-Dmc68020}%{!mc68020:%{!m68020:-Dmc68010}}}"
  368. + #endif
  369. + /* -m68000 requires special flags to the assembler.  */
  370. + #if TARGET_DEFAULT & 01
  371. + #define ASM_SPEC \
  372. +  "%{m68000:-mc68010}%{mc68000:-mc68010}%{!mc68000:%{!m68000:-mc68020}} %{msmall-code:-l} "
  373. + #else
  374. + #define ASM_SPEC \
  375. +  "%{m68020:-mc68020}%{mc68020:-mc68020}%{!mc68020:%{!m68020:-mc68010}} %{msmall-code:-l} "
  376. + #endif
  377. + /* amiga/amigados are the new "standard" defines for the Amiga, MCH_AMIGA
  378. +  * was used before and is included for compatibility reasons */
  379. + #define CPP_PREDEFINES "-Dmc68000 -Damiga -Damigados -DMCH_AMIGA -DAMIGA"
  380. + /* Chose the right startup file, depending on whether we use base relative code,
  381. +    base relative code with automatic relocation (-resident), or plain crt0.o. 
  382. +   
  383. +    Profiling is currently only available for plain startup.
  384. +    mcrt0.o does not (yet) exist. */
  385. + #define STARTFILE_SPEC                    \
  386. +   "%{resident:%{!fbaserel:-L gcc:blib }}%{fbaserel:-L gcc:blib }\
  387. + %{resident:rcrt0.o%s}%{!resident:%{!fbaserel:%{pg:gcrt0.o%s}%{!pg:%{p:mcrt0.o%s}%{!p:crt0.o%s}}}%{fbaserel:%{pg:bgcrt0.o%s}%{!pg:%{p:bmcrt0.o%s}%{!p:bcrt0.o%s}}}}"
  388. + #define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
  389. + /* if debugging, tell the linker to output amiga-hunk symbols *and*
  390. +    a BSD compatible debug hunk (which will probably change in the future, it's not
  391. +    tremendously useful in its current state). */
  392. + #define LINK_SPEC "%{g:-amiga-debug-hunk} %{fbaserel:-databss-together} %{resident:-databss-together -datadata-reloc} "
  393. + #define CC1_SPEC "%{resident:-fbaserel} "
  394. + #define CC1PLUS_SPEC "%{resident:-fbaserel} "
  395. + /* Omit frame pointer at high optimization levels. (This doesn't hurt, since
  396. +    GDB doesn't work under AmigaDOS at the moment anyway..) */
  397. +   
  398. + #define OPTIMIZATION_OPTIONS(OPTIMIZE) \
  399. + {                                  \
  400. +   if (OPTIMIZE >= 2)                         \
  401. +     flag_omit_frame_pointer = 1;                \
  402. + }
  403. + /* provide a dummy entry for the small-code switch. This is currently only
  404. +    needed by the assembler (explanations: m68k.h), but will be used by cc1
  405. +    to output 16bit pc-relative code later. */
  406. + #undef TARGET_SWITCHES
  407. + #define TARGET_SWITCHES  \
  408. +   { { "68020", 5},                \
  409. +     { "c68020", 5},                \
  410. +     { "68881", 2},                \
  411. +     { "bitfield", 4},                \
  412. +     { "68000", -5},                \
  413. +     { "c68000", -5},                \
  414. +     { "soft-float", -0102},            \
  415. +     { "nobitfield", -4},            \
  416. +     { "rtd", 8},                \
  417. +     { "nortd", -8},                \
  418. +     { "short", 040},                \
  419. +     { "noshort", -040},                \
  420. +     { "fpa", 0100},                \
  421. +     { "nofpa", -0100},                \
  422. +     { "sky", 0200},                \
  423. +     { "nosky", -0200},                \
  424. +     { "68040", 0407},                \
  425. +     { "68030", -01400},                \
  426. +     { "68030", 7},                \
  427. +     { "68040-only", 01000},            \
  428. +     { "small-code", 0 },            \
  429. +     { "", TARGET_DEFAULT}}
  430. + /* Every structure or union's size must be a multiple of 2 bytes.  */
  431. + #define STRUCTURE_SIZE_BOUNDARY 16
  432. + /* This is (almost;-)) BSD, so it wants DBX format.  */
  433. + #define DBX_DEBUGGING_INFO
  434. + /* Allow folding division by zero.  */
  435. + #define REAL_INFINITY
  436. + /* This is how to output an assembler line defining a `double' constant.  */
  437. + #undef ASM_OUTPUT_DOUBLE
  438. + #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                    \
  439. +   {                                    \
  440. +     if (REAL_VALUE_ISINF (VALUE))                    \
  441. +       fprintf (FILE, "\t.double 0r%s99e999\n", (VALUE) > 0 ? "" : "-");    \
  442. +     else if (isnan (VALUE))                        \
  443. +       {                                    \
  444. +     union { double d; long l[2];} t;                \
  445. +     t.d = (VALUE);                            \
  446. +     fprintf (FILE, "\t.long 0x%lx\n\t.long 0x%lx\n", t.l[0], t.l[1]); \
  447. +       }                                    \
  448. +     else                                \
  449. +       fprintf (FILE, "\t.double 0r%.17g\n", VALUE);            \
  450. +   }
  451. + /* This is how to output an assembler line defining a `float' constant.  */
  452. + #undef ASM_OUTPUT_FLOAT
  453. + #define ASM_OUTPUT_FLOAT(FILE,VALUE)                    \
  454. +   {                                    \
  455. +     if (REAL_VALUE_ISINF (VALUE))                    \
  456. +       fprintf (FILE, "\t.single 0r%s99e999\n", (VALUE) > 0 ? "" : "-");    \
  457. +     else if (isnan (VALUE))                        \
  458. +       {                                    \
  459. +     union { float f; long l;} t;                    \
  460. +     t.f = (VALUE);                            \
  461. +     fprintf (FILE, "\t.long 0x%lx\n", t.l);                \
  462. +       }                                    \
  463. +     else                                \
  464. +       fprintf (FILE, "\t.single 0r%.9g\n", VALUE);            \
  465. +   }
  466. + /* This is how to output an assembler lines defining floating operands.
  467. +    There's no way to output a NaN's fraction, so we lose it.  */
  468. +   
  469. + #undef ASM_OUTPUT_FLOAT_OPERAND
  470. + #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE)                \
  471. +   (REAL_VALUE_ISINF ((VALUE))                        \
  472. +    ? asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
  473. +    : (VALUE) == -0.0                            \
  474. +    ? asm_fprintf (FILE, "%I0r-0.0")                    \
  475. +    : asm_fprintf (FILE, "%I0r%.9g", (VALUE)))
  476. + #undef ASM_OUTPUT_DOUBLE_OPERAND
  477. + #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE)                \
  478. +   (REAL_VALUE_ISINF ((VALUE))                        \
  479. +    ? asm_fprintf (FILE, "%I0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
  480. +    : (VALUE) == -0.0                            \
  481. +    ? asm_fprintf (FILE, "%I0r-0.0")                    \
  482. +    : asm_fprintf (FILE, "%I0r%.17g", (VALUE)))
  483. + /* use A5 as framepointer instead of A6, this makes A6 available as a
  484. +    general purpose register, and can thus be used without problems in
  485. +    direct library calls. */
  486. + #undef FRAME_POINTER_REGNUM
  487. + #define FRAME_POINTER_REGNUM 13
  488. + #undef ARG_POINTER_REGNUM
  489. + #define ARG_POINTER_REGNUM 13
  490. + /* we use A4 for this, not A5, which is the framepointer */
  491. + #undef PIC_OFFSET_TABLE_REGNUM
  492. + #define PIC_OFFSET_TABLE_REGNUM 12
  493. + /* setup a default shell return value for those (gazillion..) programs that
  494. +    (inspite of ANSI-C) declare main() to be void (or even VOID...) and thus
  495. +    cause the shell to randomly caugh upon executing such programs (contrary
  496. +    to Unix, AmigaDOS scripts are terminated with an error if a program returns
  497. +    with an error code above the `error' or even `failure' level
  498. +    (which is configurable with the FAILAT command) */
  499. + #define DEFAULT_MAIN_RETURN c_expand_return (integer_zero_node)
  500. + /* we do have an ansi-compliant c-library ;-) */
  501. + #define HAVE_VPRINTF
  502. + #define HAVE_VFPRINTF
  503. + #define HAVE_PUTENV
  504. + #define HAVE_STRERROR
  505. + #define HAVE_ATEXIT
  506. + /* given that symbolic_operand(X), return TRUE if no special
  507. +    base relative relocation is necessary */
  508. + #define LEGITIMATE_BASEREL_OPERAND_P(X) \
  509. +   (flag_pic >= 3 && read_only_operand (X))
  510. + #undef LEGITIMATE_PIC_OPERAND_P
  511. + #define LEGITIMATE_PIC_OPERAND_P(X) \
  512. +   (! symbolic_operand (X, VOIDmode) || LEGITIMATE_BASEREL_OPERAND_P (X))
  513. + /* Define this macro if references to a symbol must be treated
  514. +    differently depending on something about the variable or
  515. +    function named by the symbol (such as what section it is in).
  516. +    The macro definition, if any, is executed immediately after the
  517. +    rtl for DECL or other node is created.
  518. +    The value of the rtl will be a `mem' whose address is a
  519. +    `symbol_ref'.
  520. +    The usual thing for this macro to do is to a flag in the
  521. +    `symbol_ref' (such as `SYMBOL_REF_FLAG') or to store a modified
  522. +    name string in the `symbol_ref' (if one bit is not enough
  523. +    information).
  524. +    On the Amiga we use this to indicate if a symbol is in text or
  525. +    data space.  */
  526. + #define ENCODE_SECTION_INFO(DECL)\
  527. + do                                    \
  528. +   {                                    \
  529. +     if (TREE_CODE (DECL) == FUNCTION_DECL)                \
  530. +       SYMBOL_REF_FLAG (XEXP (DECL_RTL (DECL), 0)) = 1;            \
  531. +     else                                \
  532. +       {                                    \
  533. +     rtx rtl = (TREE_CODE_CLASS (TREE_CODE (DECL)) != 'd'        \
  534. +            ? TREE_CST_RTL (DECL) : DECL_RTL (DECL));        \
  535. +     if (RTX_UNCHANGING_P (rtl) && !MEM_VOLATILE_P (rtl))        \
  536. +       SYMBOL_REF_FLAG (XEXP (rtl, 0)) = 1;                \
  537. +       }                                    \
  538. +   }                                    \
  539. + while (0)
  540. + #undef SELECT_RTX_SECTION
  541. + #define SELECT_RTX_SECTION(MODE, X) readonly_data_section ();
  542. + /* according to varasm.c, RELOC referrs *only* to whether constants (!)
  543. +    are addressed by address. This doesn't matter in baserelative code,
  544. +    so we allow (inspite of flag_pic) readonly_data_section() in that
  545. +    case */
  546. + #undef SELECT_SECTION
  547. + #define SELECT_SECTION(DECL, RELOC)                    \
  548. + {                                    \
  549. +   if (TREE_CODE (DECL) == STRING_CST)                    \
  550. +     {                                    \
  551. +       if (! flag_writable_strings)                    \
  552. +     readonly_data_section ();                    \
  553. +       else                                \
  554. +     data_section ();                        \
  555. +     }                                    \
  556. +   else if (TREE_CODE (DECL) == VAR_DECL)                \
  557. +     {                                    \
  558. +       if ((flag_pic && flag_pic < 3 && RELOC)                \
  559. +       || !TREE_READONLY (DECL) || TREE_SIDE_EFFECTS (DECL))        \
  560. +     data_section ();                        \
  561. +       else                                \
  562. +     readonly_data_section ();                    \
  563. +     }                                    \
  564. +   else                                    \
  565. +     readonly_data_section ();                        \
  566. + }
  567. + #if not_yet_working
  568. + /* starting support for amiga specific keywords
  569. +  * --------------------------------------------
  570. +  */
  571. + /* validate attributes that don't take a parameter. Currently we support
  572. +  * __attribute__ (saveds) and __attribute__ (interrupt)
  573. +  */
  574. + #define HANDLE_ATTRIBUTE0(attr) \
  575. +   (strcmp(attr, "saveds") != 0 && strcmp(attr, "interrupt") != 0)
  576. + /* (c-common.c)
  577. +  * install additional attributes
  578. +  */
  579. + #define HANDLE_EXTRA_ATTRIBUTES(a)                         \
  580. +   if (TREE_VALUE (a) != 0                            \
  581. +       && TREE_CODE (TREE_VALUE (a)) == IDENTIFIER_NODE                \
  582. +       && TREE_VALUE (a) == get_identifier ("saveds"))                \
  583. +     {                                        \
  584. +       if (TREE_CODE (decl) != FUNCTION_DECL)                    \
  585. +         {                                    \
  586. +           warning_with_decl (decl,                        \
  587. +               "saveds attribute specified for non-function `%s'");        \
  588. +       return;                                \
  589. +         }                                    \
  590. +                                               \
  591. +       attr_do_saveds (DECL_NAME (decl));                    \
  592. +     }                                        \
  593. +   else if (TREE_VALUE (a) != 0                            \
  594. +       && TREE_CODE (TREE_VALUE (a)) == IDENTIFIER_NODE                \
  595. +       && TREE_VALUE (a) == get_identifier ("interrupt"))            \
  596. +     {                                        \
  597. +       if (TREE_CODE (decl) != FUNCTION_DECL)                    \
  598. +         {                                    \
  599. +           warning_with_decl (decl,                        \
  600. +               "saveds attribute specified for non-function `%s'");        \
  601. +       return;                                \
  602. +         }                                    \
  603. +                                               \
  604. +       attr_do_interrupt (DECL_NAME (decl));                    \
  605. +     }                                        \
  606. + #define PROLOGUE_EXTRA_SAVE(mask)                        \
  607. +   { extern char *current_function_name;                        \
  608. +     /* saveds makes the function preserve d1/a0/a1 as well */            \
  609. +     if (attr_does_saveds (current_function_name))                \
  610. +       mask |= 0x40c0; }                                \
  611. + #define EPILOGUE_EXTRA_RESTORE(mask, nregs)                    \
  612. +   { extern char *current_function_name;                        \
  613. +     /* restore those extra registers */                        \
  614. +     if (attr_does_saveds (current_function_name))                \
  615. +       {                                        \
  616. +     mask |= 0x0302;                                \
  617. +     nregs += 3;                                \
  618. +       } }                                    \
  619. + #define EPILOGUE_EXTRA_BARRIER_KLUDGE(stream)                    \
  620. +   { extern char *current_function_name;                        \
  621. +     /* PLEASE Help! how is this done cleaner?? */                \
  622. +     if (attr_does_saveds (current_function_name))                \
  623. +       {                                        \
  624. +     fprintf (stderr,                             \
  625. +          "warning: couldn't cleanup `saveds'-stack in `%s'.\n");    \
  626. +     fprintf (stderr,                            \
  627. +          "         this is only ok, if the function never returns!\n");    \
  628. +       }    }                                    \
  629. +         
  630. + #define EPILOGUE_EXTRA_TEST(stream)                        \
  631. +   { extern char *current_function_name;                        \
  632. +     /* with the interrupt-attribute, we have to set the cc before rts */    \
  633. +     if (attr_does_interrupt (current_function_name))                \
  634. +       asm_fprintf (stream, "\ttstl %s\n", reg_names[0]); }            \
  635. + #endif
  636. diff -2rcN gcc-2.2.2/config/m68k.c my-gcc-2.2.2/config/m68k.c
  637. *** gcc-2.2.2/config/m68k.c    Wed Jun 10 04:41:20 1992
  638. --- my-gcc-2.2.2/config/m68k.c    Fri Jul 17 22:38:08 1992
  639. ***************
  640. *** 57,61 ****
  641.   finalize_pic ()
  642.   {
  643. !   if (flag_pic && current_function_uses_pic_offset_table)
  644.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  645.   }
  646. --- 57,61 ----
  647.   finalize_pic ()
  648.   {
  649. !   if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
  650.       emit_insn (gen_rtx (USE, VOIDmode, pic_offset_table_rtx));
  651.   }
  652. ***************
  653. *** 177,180 ****
  654. --- 177,183 ----
  655.         num_saved_regs--;
  656.       }
  657. + #ifdef PROLOGUE_EXTRA_SAVE
  658. +   PROLOGUE_EXTRA_SAVE (mask);
  659. + #endif
  660.     if (num_saved_regs <= 2)
  661.       {
  662. ***************
  663. *** 205,209 ****
  664.   #endif
  665.       }
  666. !   if (flag_pic && current_function_uses_pic_offset_table)
  667.       {
  668.   #ifdef MOTOROLA
  669. --- 208,212 ----
  670.   #endif
  671.       }
  672. !   if (flag_pic && (flag_pic < 3) && current_function_uses_pic_offset_table)
  673.       {
  674.   #ifdef MOTOROLA
  675. ***************
  676. *** 273,276 ****
  677. --- 276,282 ----
  678.        about which function the pc is in at this address.  */
  679.         asm_fprintf (stream, "\tnop\n");
  680. + #ifdef EPILOGUE_EXTRA_BARRIER_KLUDGE
  681. +       EPILOGUE_EXTRA_BARRIER_KLUDGE(stream);
  682. + #endif
  683.         return;
  684.       }
  685. ***************
  686. *** 303,306 ****
  687. --- 309,315 ----
  688.       mask |= 1 << regno;
  689.         }
  690. + #ifdef EPILOGUE_EXTRA_RESTORE
  691. +   EPILOGUE_EXTRA_RESTORE(mask, nregs);
  692. + #endif
  693.     offset = foffset + nregs * 4;
  694.     if (offset + fsize >= 0x8000
  695. ***************
  696. *** 505,508 ****
  697. --- 514,520 ----
  698.       }
  699.       }
  700. + #ifdef EPILOGUE_EXTRA_TEST
  701. +   EPILOGUE_EXTRA_TEST(stream);
  702. + #endif
  703.     if (current_function_pops_args)
  704.       asm_fprintf (stream, "\trtd %0I%d\n", current_function_pops_args);
  705. ***************
  706. *** 795,807 ****
  707.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  708.       {
  709.         if (reg == 0)
  710.       abort ();
  711.   
  712. !       pic_ref = gen_rtx (MEM, Pmode,
  713. !              gen_rtx (PLUS, Pmode,
  714. !                   pic_offset_table_rtx, orig));
  715.         current_function_uses_pic_offset_table = 1;
  716.         RTX_UNCHANGING_P (pic_ref) = 1;
  717.         emit_move_insn (reg, pic_ref);
  718.         return reg;
  719.       }
  720. --- 807,829 ----
  721.     if (GET_CODE (orig) == SYMBOL_REF || GET_CODE (orig) == LABEL_REF)
  722.       {
  723. + #ifdef LEGITIMATE_BASEREL_OPERAND_P
  724. +   if (LEGITIMATE_BASEREL_OPERAND_P (orig))
  725. +     return orig;
  726. + #endif
  727.         if (reg == 0)
  728.       abort ();
  729.   
  730. !       if (flag_pic >= 3)
  731. !     pic_ref = gen_rtx (PLUS, Pmode, pic_offset_table_rtx, orig);
  732. !       else
  733. !         pic_ref = gen_rtx (MEM, Pmode,
  734. !                gen_rtx (PLUS, Pmode,
  735. !                     pic_offset_table_rtx, orig));
  736.         current_function_uses_pic_offset_table = 1;
  737.         RTX_UNCHANGING_P (pic_ref) = 1;
  738.         emit_move_insn (reg, pic_ref);
  739.         return reg;
  740.       }
  741. ***************
  742. *** 832,835 ****
  743. --- 854,858 ----
  744.         /* Likewise, should we set special REG_NOTEs here?  */
  745.       }
  746.     return pic_ref;
  747.   }
  748. ***************
  749. *** 1884,1887 ****
  750. --- 1907,1914 ----
  751.               if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
  752.                 fprintf (file, ":l");
  753. +             if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
  754. +               fprintf (file, ":W");
  755. +             if ((flag_pic == 4) && (breg == pic_offset_table_rtx))
  756. +               fprintf (file, ":L");
  757.             }
  758.           fprintf (file, "(%s", reg_names[REGNO (breg)]);
  759. ***************
  760. *** 1899,1902 ****
  761. --- 1926,1933 ----
  762.               if ((flag_pic == 2) && (breg == pic_offset_table_rtx))
  763.                 fprintf (file, ":l");
  764. +             if ((flag_pic == 3) && (breg == pic_offset_table_rtx))
  765. +               fprintf (file, ":W");
  766. +             if ((flag_pic == 4) && (breg == pic_offset_table_rtx))
  767. +               fprintf (file, ":L");
  768.             }
  769.           if (addr != 0 && ireg != 0)
  770. diff -2rcN gcc-2.2.2/config/m68k.h my-gcc-2.2.2/config/m68k.h
  771. *** gcc-2.2.2/config/m68k.h    Wed Jun 10 04:42:15 1992
  772. --- my-gcc-2.2.2/config/m68k.h    Fri Jul 17 22:38:11 1992
  773. ***************
  774. *** 327,333 ****
  775.   
  776.   #define CONDITIONAL_REGISTER_USAGE \
  777. ! {                                               \
  778. !   if (flag_pic)                                 \
  779. !     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;    \
  780.   }
  781.   
  782. --- 327,336 ----
  783.   
  784.   #define CONDITIONAL_REGISTER_USAGE \
  785. ! {                                                \
  786. !   if (flag_pic)                                  \
  787. !     fixed_regs[PIC_OFFSET_TABLE_REGNUM] = 1;     \
  788. !   /* prevent saving/restoring of the base reg */ \
  789. !   if (flag_pic == 3)                 \
  790. !     call_used_regs[PIC_OFFSET_TABLE_REGNUM] = 1; \
  791.   }
  792.   
  793. diff -2rcN gcc-2.2.2/config/m68k.md my-gcc-2.2.2/config/m68k.md
  794. *** gcc-2.2.2/config/m68k.md    Wed Jun 10 04:43:59 1992
  795. --- my-gcc-2.2.2/config/m68k.md    Fri Jul 17 22:38:16 1992
  796. ***************
  797. *** 705,715 ****
  798.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  799.       {
  800. !       /* The source is an address which requires PIC relocation.  
  801. !          Call legitimize_pic_address with the source, mode, and a relocation
  802. !          register (a new pseudo, or the final destination if reload_in_progress
  803. !          is set).   Then fall through normally */
  804. !       extern rtx legitimize_pic_address();
  805. !       rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  806. !       operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  807.       }
  808.   }")
  809. --- 705,720 ----
  810.     if (flag_pic && symbolic_operand (operands[1], SImode)) 
  811.       {
  812. ! #ifdef LEGITIMATE_BASEREL_OPERAND_P
  813. !       if (flag_pic < 3 || !LEGITIMATE_BASEREL_OPERAND_P (operands[1]))
  814. ! #endif
  815. !       {
  816. !         /* The source is an address which requires PIC relocation.  
  817. !            Call legitimize_pic_address with the source, mode, and a relocation
  818. !            register (a new pseudo, or the final destination if reload_in_progress
  819. !            is set).   Then fall through normally */
  820. !         extern rtx legitimize_pic_address();
  821. !         rtx temp = reload_in_progress ? operands[0] : gen_reg_rtx (Pmode);
  822. !         operands[1] = legitimize_pic_address (operands[1], SImode, temp);
  823. !       }
  824.       }
  825.   }")
  826. ***************
  827. *** 1712,1717 ****
  828.         /* These insns can result from reloads to access
  829.        stack slots over 64k from the frame pointer.  */
  830. !       if (GET_CODE (operands[2]) == CONST_INT
  831. !       && INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000)
  832.           return \"move%.l %2,%0\;add%.l %1,%0\";
  833.   #ifdef SGS
  834. --- 1717,1723 ----
  835.         /* These insns can result from reloads to access
  836.        stack slots over 64k from the frame pointer.  */
  837. !       if (((GET_CODE (operands[2]) == CONST_INT
  838. !        && INTVAL (operands[2]) + 0x8000 >= (unsigned) 0x10000))
  839. !       || (flag_pic == 4 && operands[1] == pic_offset_table_rtx))
  840.           return \"move%.l %2,%0\;add%.l %1,%0\";
  841.   #ifdef SGS
  842. ***************
  843. *** 4645,4649 ****
  844.     "
  845.   {
  846. !   if (flag_pic && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  847.       operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
  848.                  force_reg (Pmode, XEXP (operands[0], 0)));
  849. --- 4651,4655 ----
  850.     "
  851.   {
  852. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[0], 0)) == SYMBOL_REF)
  853.       operands[0] = gen_rtx (MEM, GET_MODE (operands[0]),
  854.                  force_reg (Pmode, XEXP (operands[0], 0)));
  855. ***************
  856. *** 4656,4660 ****
  857.     ;; Operand 1 not really used on the m68000.
  858.   
  859. !   "! flag_pic"
  860.     "*
  861.   #ifdef MOTOROLA
  862. --- 4662,4666 ----
  863.     ;; Operand 1 not really used on the m68000.
  864.   
  865. !   "(! flag_pic || flag_pic >= 3)"
  866.     "*
  867.   #ifdef MOTOROLA
  868. ***************
  869. *** 4671,4675 ****
  870.     ;; Operand 1 not really used on the m68000.
  871.   
  872. !   "flag_pic"
  873.     "*
  874.     return \"jsr %0\";
  875. --- 4677,4681 ----
  876.     ;; Operand 1 not really used on the m68000.
  877.   
  878. !   "(flag_pic && flag_pic < 3)"
  879.     "*
  880.     return \"jsr %0\";
  881. ***************
  882. *** 4687,4691 ****
  883.     "
  884.   {
  885. !   if (flag_pic && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  886.       operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
  887.                  force_reg (Pmode, XEXP (operands[1], 0)));
  888. --- 4693,4697 ----
  889.     "
  890.   {
  891. !   if (flag_pic && flag_pic < 3 && GET_CODE (XEXP (operands[1], 0)) == SYMBOL_REF)
  892.       operands[1] = gen_rtx (MEM, GET_MODE (operands[1]),
  893.                  force_reg (Pmode, XEXP (operands[1], 0)));
  894. ***************
  895. *** 4698,4702 ****
  896.             (match_operand:SI 2 "general_operand" "g")))]
  897.     ;; Operand 2 not really used on the m68000.
  898. !   "! flag_pic"
  899.     "*
  900.   #ifdef MOTOROLA
  901. --- 4704,4708 ----
  902.             (match_operand:SI 2 "general_operand" "g")))]
  903.     ;; Operand 2 not really used on the m68000.
  904. !   "(! flag_pic || flag_pic >= 3)"
  905.     "*
  906.   #ifdef MOTOROLA
  907. ***************
  908. *** 4713,4717 ****
  909.             (match_operand:SI 2 "general_operand" "g")))]
  910.     ;; Operand 2 not really used on the m68000.
  911. !   "flag_pic"
  912.     "*
  913.     return \"jsr %1\";
  914. --- 4719,4723 ----
  915.             (match_operand:SI 2 "general_operand" "g")))]
  916.     ;; Operand 2 not really used on the m68000.
  917. !   "(flag_pic && flag_pic < 3)"
  918.     "*
  919.     return \"jsr %1\";
  920. diff -2rcN gcc-2.2.2/config/t-amigados my-gcc-2.2.2/config/t-amigados
  921. *** gcc-2.2.2/config/t-amigados
  922. --- my-gcc-2.2.2/config/t-amigados    Fri Jul 17 22:38:18 1992
  923. ***************
  924. *** 0 ****
  925. --- 1,81 ----
  926. + # compilation rules for target amigados. We generate two additional things:
  927. + # libngcc.a: a `normal' library, the automatically generated libgcc.a is
  928. + #            base relative (which is the right thing, since it's used to
  929. + #         generate further generations of compilers).
  930. + # gccs:         a gcc calling ssytem() instead of forking. This makes it more
  931. + #         system conformant, at the cost of reduced functionality (no
  932. + #         -pipe option).
  933. + # the provided file is POSIX compliant
  934. + LIMITS_H =
  935. + # we don't need a libgcc1, it's all in ixemul.library
  936. + LIBGCC1 = libgcc1.null
  937. + # use flags that don't generate base relative objects. So -resident
  938. + # would be a bad idea..
  939. + LIBNGCC2_CFLAGS = -O2 $(INTERNAL_CFLAGS) $(CFLAGS) -B./
  940. + # this is later copied into gcc:compilers/amiga/<version>/libgcc.a, whereas
  941. + # libgcc.a is copied into gcc:blib/libgcc.a, which is searched first if we're
  942. + # compiling/linking base relative
  943. + EXTRA_PARTS = libngcc.a
  944. + # this includes the knowledge that target amigados doesn't need 
  945. + # libgcc1.a at all
  946. + libngcc.a: libgcc2.c libgcc2.ready $(CONFIG_H) $(LIB2FUNCS_EXTRA) \
  947. +    longlong.h gbl-ctors.h config.status
  948. + # Actually build it in tmplibngcc.a, then rename at end,
  949. + # so that libngcc.a itself remains nonexistent if compilation is aborted.
  950. +     -rm -f tmplibngcc.a
  951. + # -e causes any failing command to make this rule fail.
  952. + # -e doesn't work in certain shells, so we test $$? as well.
  953. +     set -e; \
  954. +     for name in $(LIB2FUNCS); \
  955. +     do \
  956. +       echo $${name}; \
  957. +       $(GCC_FOR_TARGET) $(LIBNGCC2_CFLAGS) $(INCLUDES) -c -DL$${name} \
  958. +           $(srcdir)/libgcc2.c -o $${name}.o; \
  959. +       if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  960. +       $(AR) $(AR_FLAGS) tmplibngcc.a $${name}.o; \
  961. +       rm -f $${name}.o; \
  962. +     done
  963. + # Some shells crash when a loop has no items.
  964. + # So make sure there is always at least one--`..'.
  965. + # Then ignore it.
  966. + # We don't use -e here because there are if statements
  967. + # that should not make the command give up when the if condition is false.
  968. + # Instead, we test for failure after each command where it matters.
  969. +     -for file in .. $(LIB2FUNCS_EXTRA); \
  970. +     do \
  971. +       if [ x$${file} != x.. ]; then \
  972. +         name=`echo $${file} | sed -e 's/[.]c$$//' -e 's/[.]asm$$//'`; \
  973. +         echo $${name}; \
  974. +         if [ $${name}.asm = $${file} ]; then \
  975. +           cp $${file} $${name}.s; file=$${name}.s; \
  976. +           if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  977. +         else true; fi; \
  978. +         $(GCC_FOR_TARGET) $(LIBGCC2_CFLAGS) $(INCLUDES) -c $${file}; \
  979. +         if [ $$? -eq 0 ] ; then true; else exit 1; fi; \
  980. +         $(AR) $(AR_FLAGS) tmplibngcc.a $${name}.o; \
  981. +         rm -f $${name}.[so]; \
  982. +       else true; \
  983. +       fi; \
  984. +     done
  985. +     mv tmplibngcc.a libngcc.a
  986. +     ranlib libngcc.a
  987. + T_CPPFLAGS = -DAMIGADOS_FORK_GCC
  988. + # the default gcc (xgcc) specifies -DAMIGADOS_FORK_GCC. This gcc (gccs) does not.
  989. + EXTRA_PASSES = gccs
  990. + gccs: gccs.o version.o $(LIBDEPS)
  991. +     $(CC) $(ALL_CFLAGS) $(LDFLAGS) -o gccs gccs.o version.o $(LIBS)
  992. + # omit the T_CPPFLAGS here on purpose to get rid of -DAMIGADOS_FORK_GCC
  993. + gccs.o: gcc.c $(CONFIG_H) gvarargs.h obstack.h
  994. +     $(CC) $(ALL_CFLAGS) $(CPPFLAGS) $(X_CPPFLAGS) $(INCLUDES) \
  995. +   -DSTANDARD_STARTFILE_PREFIX=\"$(libdir)/\" \
  996. +   -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc-lib/\" \
  997. +   -DDEFAULT_TARGET_MACHINE=\"$(target)\" \
  998. +   -c `echo $(srcdir)/gcc.c | sed 's,^\./,,'` -o gccs.o
  999. diff -2rcN gcc-2.2.2/config/x-amigados my-gcc-2.2.2/config/x-amigados
  1000. *** gcc-2.2.2/config/x-amigados
  1001. --- my-gcc-2.2.2/config/x-amigados    Fri Jul 17 22:38:20 1992
  1002. ***************
  1003. *** 0 ****
  1004. --- 1,50 ----
  1005. + # building under amigados requires an already working gcc. You can of course
  1006. + # try to reinvent the wheel, get sun2manx and try to do a crosscompile from a
  1007. + # sun3, like I did some years ago...
  1008. + CC = gccv # this is a gcc compiled with AMIGADOS_FORK_GCC
  1009. + # if your gcc has not been compiled with -DAMIGADOS_FORK_GCC, then don't use
  1010. + # -pipe! (see also t-amigados !)
  1011. + # The -fno-builtin is necessary, or gcc uses the builtin alloca() by default,
  1012. + # and we can't undef it for cpp
  1013. + X_CFLAGS = -O2 -resident -pipe -fno-builtin
  1014. + exec_prefix = gcc:compilers
  1015. + bindir = gcc:bin
  1016. + libdir = gcc:lib
  1017. + manext = .0
  1018. + mandir = gcc:man/man1
  1019. + # don't compile with debugging, as long as there is no debugger...
  1020. + LIBGCC2_CFLAGS = -O2 $(GCC_CFLAGS)
  1021. + # we really shouldn't specify CFLAGS from here, but there's no other way
  1022. + # to get rid of the `-g' indoctrinated by Makefile.in...
  1023. + CFLAGS =
  1024. + RANLIB_TEST = true
  1025. + RANLIB = ranlib
  1026. + # override the default compilation rule for libgcc.a, since the original
  1027. + # rule doesn't work well with the amigados ksh (the subshell cd'ing into
  1028. + # tmplibgcc is still running when the rm -fr tmplibgcc is started, and at
  1029. + # that point trying to remove the directory fails because the previous
  1030. + # process still keeps a lock (its current directory) to that directory).
  1031. + # Combine the various libraries into a single library, libgcc.a.
  1032. + libgcc.a: $(LIBGCC1) $(LIBGCC2)
  1033. +     -rm -rf tmplibgcc.a libgcc.a tmpcopy
  1034. +     mkdir tmpcopy
  1035. +     -if [ x$(LIBGCC1) != x ];            \
  1036. +     then (cd tmpcopy; $(AR) x ../$(LIBGCC1));    \
  1037. +     else true;                    \
  1038. +     fi
  1039. + # the cd .. make sure there's no lock left on tmpcopy (this is actually a
  1040. + # bug in ixemul.library, but I can't get around it currently because it
  1041. + # involves an OS bug which is beyond my capabilities to fix...)
  1042. +     (cd tmpcopy; $(AR) x ../$(LIBGCC2); cd ..; /c/wait 2)
  1043. +     (cd tmpcopy; $(AR) $(AR_FLAGS) ../tmplibgcc.a *.o; cd ..; /c/wait 2)
  1044. +     rm -rf tmpcopy
  1045. +     -if $(RANLIB_TEST) ; then $(RANLIB) tmplibgcc.a; else true; fi
  1046. + # Actually build it in tmplibgcc.a, then rename at end,
  1047. + # so that libgcc.a itself remains nonexistent if compilation is aborted.
  1048. +     mv tmplibgcc.a libgcc.a
  1049. diff -2rcN gcc-2.2.2/config/xm-amigados.h my-gcc-2.2.2/config/xm-amigados.h
  1050. *** gcc-2.2.2/config/xm-amigados.h
  1051. --- my-gcc-2.2.2/config/xm-amigados.h    Fri Jul 17 22:38:22 1992
  1052. ***************
  1053. *** 0 ****
  1054. --- 1,234 ----
  1055. + /*  Configuration for GNU C-compiler for Commodore Amiga, running AmigaDOS.
  1056. +    Copyright (C) 1992 Free Software Foundation, Inc.
  1057. +    Contributed by Markus M. Wild (wild@amiga.physik.unizh.ch).
  1058. + This file is part of GNU CC.
  1059. + GNU CC is free software; you can redistribute it and/or modify
  1060. + it under the terms of the GNU General Public License as published by
  1061. + the Free Software Foundation; either version 2, or (at your option)
  1062. + any later version.
  1063. + GNU CC is distributed in the hope that it will be useful,
  1064. + but WITHOUT ANY WARRANTY; without even the implied warranty of
  1065. + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  1066. + GNU General Public License for more details.
  1067. + You should have received a copy of the GNU General Public License
  1068. + along with GNU CC; see the file COPYING.  If not, write to
  1069. + the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  1070. + /* first include the generic header, then modify some parts.. */
  1071. + #include "xm-m68k.h"
  1072. + #undef GCC_INCLUDE_DIR
  1073. + #define GCC_INCLUDE_DIR ":GCC_INCLUDE_DIR is not used under AmigaDOS!:"
  1074. + /* use this list of header files instead of the Unix'ish default */
  1075. + #define INCLUDE_DEFAULTS \
  1076. + {                                    \
  1077. +   { "gcc:g++-include", 1},                        \
  1078. +   { "gcc:gcc-include", 0}, /* gcc-specific changes to system headers. none currently.. */ \
  1079. +   { "gcc:os-include", 0},  /* here go amiga specific headers */     \
  1080. +   { "gcc:include", 0},     /* here go the usual headers */         \
  1081. +   { 0, 0}                                \
  1082. + }
  1083. + /* here live the compiler passes like cc1, cc1plus, cpp etc */
  1084. + #undef STANDARD_EXEC_PREFIX
  1085. + #define STANDARD_EXEC_PREFIX "gcc:compilers/"
  1086. + /* here live (%|b|r)crt0.o and different flavors of link-libraries */
  1087. + #undef STANDARD_STARTFILE_PREFIX
  1088. + #define STANDARD_STARTFILE_PREFIX "gcc:lib/"
  1089. + /* the `compilers' place looks better, since we have the machine/version tree
  1090. +    there, and not in `lib'. */
  1091. + #undef STD_PROTO_DIR
  1092. + #define STD_PROTO_DIR STANDARD_EXEC_PREFIX
  1093. + /* Fork one piped subcommand.  SEARCH_FLAG is the system call to use
  1094. +    (either execv or execvp).  ARGV is the arg vector to use.
  1095. +    NOT_LAST is nonzero if this is not the last subcommand
  1096. +    (i.e. its output should be piped to the next one.)  */
  1097. + #ifndef AMIGADOS_FORK_GCC
  1098. + /* this version uses a more or less amigados-conformant way of running a
  1099. +    program (in the context of the parent). If you want to use -pipe however,
  1100. +    you'll have to use the vfork() version afterwards. */
  1101. + #define PEXECUTE(SEARCH_FLAG,PROGRAM,ARGV,NOT_LAST) \
  1102. + ({char *_argline;                        \
  1103. +   int _arglinelength, _i;                    \
  1104. +                                 \
  1105. +   for (_i = 1, _arglinelength=0; ARGV[_i]; ++_i)        \
  1106. +     _arglinelength += strlen(ARGV[_i]) + 1;            \
  1107. +                                 \
  1108. +   _arglinelength += strlen(PROGRAM) + 1;            \
  1109. +                                 \
  1110. +   if (!(_argline = (char *)alloca(_arglinelength)))         \
  1111. +     pfatal_with_name ("alloca");                \
  1112. +                                 \
  1113. +   strcpy(_argline, PROGRAM);                    \
  1114. +   for (_i = 1; ARGV[_i]; ++_i)                     \
  1115. +     {                                \
  1116. +       strcat(_argline, " ");                    \
  1117. +       strcat(_argline, ARGV[_i]);                \
  1118. +     }                                \
  1119. +                                 \
  1120. +   ssystem(_argline); })                        \
  1121. + #define PEXECUTE_RESULT(STATUS, COMMAND) \
  1122. +   ({ STATUS = COMMAND.pid; })
  1123. + #else
  1124. + /* the vfork() version. This one has the drawback, that gcc is not 
  1125. +    interruptible when started from make, since ixemul.library doesn't yet
  1126. +    propagate ^C to subprocesses. */
  1127. + #define PEXECUTE(SEARCH_FLAG,PROGRAM,ARGV,NOT_LAST) \
  1128. + ({int (*_func)() = (SEARCH_FLAG ? execv : execvp);            \
  1129. +   int _pid;                                \
  1130. +   int _pdes[2];                                \
  1131. +   int _input_desc = last_pipe_input;                    \
  1132. +   int _output_desc = STDOUT_FILE_NO;                    \
  1133. +   int _retries, _sleep_interval, _result;                \
  1134. +                                     \
  1135. +   /* If this isn't the last process, make a pipe for its output,    \
  1136. +      and record it as waiting to be the input to the next process.  */    \
  1137. +                                     \
  1138. +   if (NOT_LAST)                                \
  1139. +     {                                    \
  1140. +       if (pipe (_pdes) < 0)                        \
  1141. +     pfatal_with_name ("pipe");                    \
  1142. +       _output_desc = _pdes[WRITE_PORT];                    \
  1143. +       last_pipe_input = _pdes[READ_PORT];                \
  1144. +     }                                    \
  1145. +   else                                    \
  1146. +     last_pipe_input = STDIN_FILE_NO;                    \
  1147. +                                     \
  1148. +   /* Fork a subprocess; wait and retry if it fails.  */            \
  1149. +   _sleep_interval = 1;                            \
  1150. +   for (_retries = 0; _retries < 4; _retries++)                \
  1151. +     {                                    \
  1152. +       _pid = vfork ();                            \
  1153. +       if (_pid >= 0)                            \
  1154. +     break;                                \
  1155. +       sleep (_sleep_interval);                        \
  1156. +       _sleep_interval *= 2;                        \
  1157. +     }                                    \
  1158. +                                     \
  1159. +   switch (_pid)                                \
  1160. +     {                                    \
  1161. +     case -1:                                \
  1162. +       pfatal_with_name ("vfork");                    \
  1163. +       /* NOTREACHED */                            \
  1164. +       _result = 0;                            \
  1165. +       break;                                \
  1166. +                                     \
  1167. +     case 0: /* child */                            \
  1168. +       /* Move the input and output pipes into place, if nec.  */    \
  1169. +       if (_input_desc != STDIN_FILE_NO)                    \
  1170. +     {                                \
  1171. +       close (STDIN_FILE_NO);                    \
  1172. +       dup (_input_desc);                        \
  1173. +       close (_input_desc);                        \
  1174. +     }                                \
  1175. +       if (_output_desc != STDOUT_FILE_NO)                \
  1176. +     {                                \
  1177. +       close (STDOUT_FILE_NO);                    \
  1178. +       dup (_output_desc);                        \
  1179. +       close (_output_desc);                        \
  1180. +     }                                \
  1181. +                                     \
  1182. +       /* Close the parent's descs that aren't wanted here.  */        \
  1183. +       if (last_pipe_input != STDIN_FILE_NO)                \
  1184. +     close (last_pipe_input);                    \
  1185. +                                     \
  1186. +       /* Exec the program.  */                        \
  1187. +       (*_func) (PROGRAM, ARGV);                        \
  1188. +       perror_exec (PROGRAM);                        \
  1189. +       exit (-1);                            \
  1190. +       /* NOTREACHED */                            \
  1191. +       _result = 0;                            \
  1192. +       break;                                \
  1193. +                                     \
  1194. +     default:                                \
  1195. +       /* In the parent, after forking.                    \
  1196. +      Close the descriptors that we made for this child.  */        \
  1197. +       if (_input_desc != STDIN_FILE_NO)                    \
  1198. +     close (_input_desc);                        \
  1199. +       if (_output_desc != STDOUT_FILE_NO)                \
  1200. +     close (_output_desc);                        \
  1201. +                                     \
  1202. +       /* Return child's process number.  */                \
  1203. +       _result = _pid;                            \
  1204. +       break;                                \
  1205. +     }                                     \
  1206. + _result; })                                \
  1207. + #define PEXECUTE_RESULT(STATUS, COMMAND) \
  1208. +   ({ wait (& STATUS); })
  1209. + #endif /* AMIGADOS_FORK_GCC */
  1210. + /* the following macros are stolen more or less from xm-vms.h ... */
  1211. + /* This macro is used to help compare filenames in cp-lex.c.
  1212. +    We also need to make sure that the names are all lower case, because
  1213. +    we must be able to compare filenames to determine if a file implements
  1214. +    a class.  */
  1215. + #define FILE_NAME_NONDIRECTORY(C)                \
  1216. + ({                                \
  1217. +    char * pnt_ = (C), * pnt1_;                    \
  1218. +    pnt1_ = pnt_ - 1;                        \
  1219. +    while (*++pnt1_)                        \
  1220. +      if ((*pnt1_ >= 'A' && *pnt1_ <= 'Z')) *pnt1_ |= 0x20;    \
  1221. +    pnt1_ = rindex (pnt_, '/');                     \
  1222. +    pnt1_ = (pnt1_ == 0 ? rindex (pnt_, ':') : pnt1_);        \
  1223. +    (pnt1_ == 0 ? pnt_ : pnt1_ + 1);                \
  1224. +  })
  1225. + /* Macro to generate the name of the cross reference file.  The standard
  1226. +    one does not work, since it was written assuming that the conventions
  1227. +    of a unix style filesystem will work on the host system.
  1228. +  
  1229. +    Contrary to VMS, I'm using the original unix filename, there's no reason
  1230. +    not to use this under AmigaDOS. */
  1231. + #define XREF_FILE_NAME(BUFF, NAME)    \
  1232. +   s = FILE_NAME_NONDIRECTORY (NAME);            \
  1233. +   if (s == NAME) sprintf(BUFF, ".%s.gxref", NAME);    \
  1234. +   else {                        \
  1235. +     unsigned char ch = *s; /* could be Latin1 char.. */    \
  1236. +     /* temporary: cut the filename from the directory */\
  1237. +     *s = 0;                        \
  1238. +     sprintf (BUFF, "%s.%c%s.gxref", NAME, ch, s+1);    \
  1239. +     /* and restore the filename */            \
  1240. +     *s = ch;                        \
  1241. +   }                            \
  1242. + /* Macro that is used in cp-xref.c to determine whether a file name is
  1243. +    absolute or not.
  1244. +    This checks for both, '/' as first character, since we're running under
  1245. +    ixemul.library which provides for this unix'ism, and for the usual 
  1246. +    logical-terminator, ':', somewhere in the filename. */
  1247. + #define FILE_NAME_ABSOLUTE_P(NAME) (NAME[0] == '/' || index(NAME, ':'))
  1248. + /* the colon conflicts with the name space of logicals */
  1249. + #define PATH_SEPARATOR ','
  1250. + /* AmigaDOS handles rename(2) *much* better than any link(2)/unlink(2)
  1251. +    hacks. It's actually the inverse case as on Unix. rename(2) was always
  1252. +    there, link(2) is new with OS 2.0 */
  1253. + #define HAVE_rename 1
  1254. diff -2rcN gcc-2.2.2/configure my-gcc-2.2.2/configure
  1255. *** gcc-2.2.2/configure    Thu Jun 11 19:46:42 1992
  1256. --- my-gcc-2.2.2/configure    Fri Jul 17 22:38:41 1992
  1257. ***************
  1258. *** 359,362 ****
  1259. --- 359,369 ----
  1260.           xmake_file=x-sparcv4
  1261.           ;;
  1262. +     m68k-*-amigados)
  1263. +         xm_file=xm-amigados.h
  1264. +         out_file=amigados.c
  1265. +         tm_file=amigados.h
  1266. +         tmake_file=t-amigados
  1267. +         xmake_file=x-amigados
  1268. +         ;;
  1269.       sparc-*-solaris2*)
  1270.           xm_file=xm-spcv4.h
  1271. diff -2rcN gcc-2.2.2/expr.c my-gcc-2.2.2/expr.c
  1272. *** gcc-2.2.2/expr.c    Wed Jun  3 19:42:57 1992
  1273. --- my-gcc-2.2.2/expr.c    Fri Jul 17 22:38:46 1992
  1274. ***************
  1275. *** 1697,1700 ****
  1276. --- 1697,1706 ----
  1277.     argvec = (struct arg *) alloca (nargs * sizeof (struct arg));
  1278.   
  1279. + /* how would you do this RIGHT ?? fake a DECL node? dunno... */
  1280. + #ifdef ENCODE_SECTION_INFO
  1281. +   /* mark it as a function (to be in the text section that is) */
  1282. +   SYMBOL_REF_FLAG (fun) = 1;
  1283. + #endif
  1284.     INIT_CUMULATIVE_ARGS (args_so_far, (tree)0, fun);
  1285.   
  1286. diff -2rcN gcc-2.2.2/gcc.c my-gcc-2.2.2/gcc.c
  1287. *** gcc-2.2.2/gcc.c    Wed Jun 10 21:23:54 1992
  1288. --- my-gcc-2.2.2/gcc.c    Fri Jul 17 22:38:52 1992
  1289. ***************
  1290. *** 87,91 ****
  1291. --- 87,95 ----
  1292.   
  1293.   extern int errno, sys_nerr;
  1294. + #ifndef HAVE_STRERROR
  1295. + /* provide a cheap strerror() emulator for those that don't have it */
  1296.   extern char *sys_errlist[];
  1297. + #define strerror(err) sys_errlist[err]
  1298. + #endif
  1299.   
  1300.   extern int execv (), execvp ();
  1301. ***************
  1302. *** 1058,1061 ****
  1303. --- 1062,1068 ----
  1304.         if (base == (char *)0)
  1305.       {
  1306. + #ifdef amigados
  1307. +       base = "ram:";
  1308. + #else
  1309.         if (access ("/usr/tmp", R_OK | W_OK) == 0)
  1310.           base = "/usr/tmp/";
  1311. ***************
  1312. *** 1062,1065 ****
  1313. --- 1069,1073 ----
  1314.         else
  1315.           base = "/tmp/";
  1316. + #endif
  1317.       }
  1318.       }
  1319. ***************
  1320. *** 1068,1072 ****
  1321.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX"));
  1322.     strcpy (temp_filename, base);
  1323. !   if (len > 0 && temp_filename[len-1] != '/')
  1324.       temp_filename[len++] = '/';
  1325.     strcpy (temp_filename + len, "ccXXXXXX");
  1326. --- 1076,1084 ----
  1327.     temp_filename = xmalloc (len + sizeof("/ccXXXXXX"));
  1328.     strcpy (temp_filename, base);
  1329. !   if (len > 0 && temp_filename[len-1] != '/'
  1330. ! #ifdef amigados
  1331. !                         && temp_filename[len-1] != ':'
  1332. ! #endif
  1333. !                                     )
  1334.       temp_filename[len++] = '/';
  1335.     strcpy (temp_filename + len, "ccXXXXXX");
  1336. ***************
  1337. *** 1140,1143 ****
  1338. --- 1152,1156 ----
  1339.     int first_time = TRUE;
  1340.     struct prefix_list *pprefix;
  1341. +   char path_sep[] = { PATH_SEPARATOR, 0 };
  1342.   
  1343.     obstack_grow (&collect_obstack, env_var, strlen (env_var));
  1344. ***************
  1345. *** 1150,1154 ****
  1346.       {
  1347.         if (!first_time)
  1348. !         obstack_grow (&collect_obstack, ":", 1);
  1349.           
  1350.         first_time = FALSE;
  1351. --- 1163,1167 ----
  1352.       {
  1353.         if (!first_time)
  1354. !         obstack_grow (&collect_obstack, path_sep, 1);
  1355.           
  1356.         first_time = FALSE;
  1357. ***************
  1358. *** 1160,1164 ****
  1359.       {
  1360.         if (!first_time)
  1361. !         obstack_grow (&collect_obstack, ":", 1);
  1362.   
  1363.         first_time = FALSE;
  1364. --- 1173,1177 ----
  1365.       {
  1366.         if (!first_time)
  1367. !         obstack_grow (&collect_obstack, path_sep, 1);
  1368.   
  1369.         first_time = FALSE;
  1370. ***************
  1371. *** 1193,1197 ****
  1372.     /* Determine the filename to execute (special case for absolute paths).  */
  1373.   
  1374. !   if (*name == '/')
  1375.       {
  1376.         if (access (name, mode))
  1377. --- 1206,1214 ----
  1378.     /* Determine the filename to execute (special case for absolute paths).  */
  1379.   
  1380. !   if (*name == '/'
  1381. ! #ifdef amigados
  1382. !           || index (name, ':')
  1383. ! #endif
  1384. !                     )
  1385.       {
  1386.         if (access (name, mode))
  1387. ***************
  1388. *** 1369,1372 ****
  1389. --- 1386,1390 ----
  1390.      (i.e. its output should be piped to the next one.)  */
  1391.   
  1392. + #ifndef PEXECUTE
  1393.   #ifndef OS2
  1394.   #ifdef __MSDOS__
  1395. ***************
  1396. *** 1500,1505 ****
  1397.         return pid;
  1398.       }
  1399. - }
  1400.   #endif /* not __MSDOS__ */
  1401.   #else /* not OS2 */
  1402. --- 1518,1521 ----
  1403. ***************
  1404. *** 1515,1518 ****
  1405. --- 1531,1536 ----
  1406.   }
  1407.   #endif /* not OS2 */
  1408. + }
  1409. + #endif /* !defined(PEXECUTE) */
  1410.   
  1411.   /* Execute the command specified by the arguments on the current line of spec.
  1412. ***************
  1413. *** 1609,1615 ****
  1414. --- 1627,1639 ----
  1415.         char *string = commands[i].argv[0];
  1416.   
  1417. + #ifdef PEXECUTE
  1418. +       commands[i].pid = PEXECUTE (string != commands[i].prog,
  1419. +                   string, commands[i].argv,
  1420. +                   i + 1 < n_commands);
  1421. + #else
  1422.         commands[i].pid = pexecute (string != commands[i].prog,
  1423.                     string, commands[i].argv,
  1424.                     i + 1 < n_commands);
  1425. + #endif
  1426.   
  1427.         if (string != commands[i].prog)
  1428. ***************
  1429. *** 1632,1635 ****
  1430. --- 1656,1662 ----
  1431.       char *prog;
  1432.   
  1433. + #ifdef PEXECUTE_RESULT
  1434. +     pid = PEXECUTE_RESULT (status, commands[i]);
  1435. + #else /* PEXECUTE_RESULT */
  1436.   #ifdef __MSDOS__
  1437.           status = pid = commands[i].pid;
  1438. ***************
  1439. *** 1637,1640 ****
  1440. --- 1664,1668 ----
  1441.       pid = wait (&status);
  1442.   #endif
  1443. + #endif /* PEXECUTE_RESULT */
  1444.       if (pid < 0)
  1445.         abort ();
  1446. ***************
  1447. *** 1722,1726 ****
  1448.   
  1449.     /* COMPILER_PATH and LIBRARY_PATH have values
  1450. !      that are lists of directory names with colons.  */
  1451.   
  1452.     temp = getenv ("COMPILER_PATH");
  1453. --- 1750,1754 ----
  1454.   
  1455.     /* COMPILER_PATH and LIBRARY_PATH have values
  1456. !      that are lists of directory names with PATH_SEPARATOR.  */
  1457.   
  1458.     temp = getenv ("COMPILER_PATH");
  1459. ***************
  1460. *** 1733,1739 ****
  1461.         while (1)
  1462.       {
  1463. !       if (*endp == PATH_SEPARATOR || *endp == 0)
  1464.           {
  1465.             strncpy (nstore, startp, endp-startp);
  1466.             if (endp == startp)
  1467.           {
  1468. --- 1761,1768 ----
  1469.         while (1)
  1470.       {
  1471. !       if ((*endp == PATH_SEPARATOR) || (*endp == 0))
  1472.           {
  1473.             strncpy (nstore, startp, endp-startp);
  1474. + #ifndef amigados
  1475.             if (endp == startp)
  1476.           {
  1477. ***************
  1478. *** 1747,1750 ****
  1479. --- 1776,1788 ----
  1480.             else
  1481.           nstore[endp-startp] = 0;
  1482. + #else
  1483. +           if (endp[-1] != '/' && endp[-1] != ':')
  1484. +         {
  1485. +           nstore[endp-startp] = '/';
  1486. +           nstore[endp-startp+1] = 0;
  1487. +         }
  1488. +           else
  1489. +         nstore[endp-startp] = 0;
  1490. + #endif
  1491.             add_prefix (&exec_prefix, nstore, 0, 0, 0);
  1492.             if (*endp == 0)
  1493. ***************
  1494. *** 1766,1772 ****
  1495.         while (1)
  1496.       {
  1497. !       if (*endp == PATH_SEPARATOR || *endp == 0)
  1498.           {
  1499.             strncpy (nstore, startp, endp-startp);
  1500.             if (endp == startp)
  1501.           {
  1502. --- 1804,1811 ----
  1503.         while (1)
  1504.       {
  1505. !       if ((*endp == PATH_SEPARATOR) || (*endp == 0))
  1506.           {
  1507.             strncpy (nstore, startp, endp-startp);
  1508. + #ifndef amigados
  1509.             if (endp == startp)
  1510.           {
  1511. ***************
  1512. *** 1780,1783 ****
  1513. --- 1819,1831 ----
  1514.             else
  1515.           nstore[endp-startp] = 0;
  1516. + #else
  1517. +           if (endp[-1] != '/' && endp[-1] != ':')
  1518. +         {
  1519. +           nstore[endp-startp] = '/';
  1520. +           nstore[endp-startp+1] = 0;
  1521. +         }
  1522. +           else
  1523. +         nstore[endp-startp] = 0;
  1524. + #endif
  1525.             add_prefix (&startfile_prefix, nstore, 0, 0, 0);
  1526.             /* Make separate list of dirs that came from LIBRARY_PATH.  */
  1527. ***************
  1528. *** 1802,1808 ****
  1529.         while (1)
  1530.       {
  1531. !       if (*endp == PATH_SEPARATOR || *endp == 0)
  1532.           {
  1533.             strncpy (nstore, startp, endp-startp);
  1534.             if (endp == startp)
  1535.           {
  1536. --- 1850,1857 ----
  1537.         while (1)
  1538.       {
  1539. !       if ((*endp == PATH_SEPARATOR) || (*endp == 0))
  1540.           {
  1541.             strncpy (nstore, startp, endp-startp);
  1542. + #ifndef amigados
  1543.             if (endp == startp)
  1544.           {
  1545. ***************
  1546. *** 1816,1819 ****
  1547. --- 1865,1877 ----
  1548.             else
  1549.           nstore[endp-startp] = 0;
  1550. + #else
  1551. +           if (endp[-1] != '/' && endp[-1] != ':')
  1552. +         {
  1553. +           nstore[endp-startp] = '/';
  1554. +           nstore[endp-startp+1] = 0;
  1555. +         }
  1556. +           else
  1557. +         nstore[endp-startp] = 0;
  1558. + #endif
  1559.             add_prefix (&startfile_prefix, nstore, 0, 0, 0);
  1560.             /* Make separate list of dirs that came from LIBRARY_PATH.  */
  1561. ***************
  1562. *** 3159,3162 ****
  1563. --- 3217,3223 ----
  1564.         register char *p;
  1565.   
  1566. + #ifdef FILE_NAME_NONDIRECTORY
  1567. +       input_basename = FILE_NAME_NONDIRECTORY (input_filename);
  1568. + #else
  1569.         input_basename = input_filename;
  1570.         for (p = input_filename; *p; p++)
  1571. ***************
  1572. *** 3163,3166 ****
  1573. --- 3224,3228 ----
  1574.           if (*p == '/')
  1575.             input_basename = p + 1;
  1576. + #endif
  1577.   
  1578.         /* Find a suffix starting with the last period,
  1579. ***************
  1580. *** 3384,3388 ****
  1581.   
  1582.     if (errno < sys_nerr)
  1583. !     s = concat ("%s: ", sys_errlist[errno], "");
  1584.     else
  1585.       s = "cannot open %s";
  1586. --- 3446,3450 ----
  1587.   
  1588.     if (errno < sys_nerr)
  1589. !     s = concat ("%s: ", strerror (errno), "");
  1590.     else
  1591.       s = "cannot open %s";
  1592. ***************
  1593. *** 3397,3401 ****
  1594.   
  1595.     if (errno < sys_nerr)
  1596. !     s = concat ("%s: ", sys_errlist[errno], "");
  1597.     else
  1598.       s = "cannot open %s";
  1599. --- 3459,3463 ----
  1600.   
  1601.     if (errno < sys_nerr)
  1602. !     s = concat ("%s: ", strerror (errno), "");
  1603.     else
  1604.       s = "cannot open %s";
  1605. ***************
  1606. *** 3411,3415 ****
  1607.     if (errno < sys_nerr)
  1608.       s = concat ("installation problem, cannot exec %s: ",
  1609. !         sys_errlist[errno], "");
  1610.     else
  1611.       s = "installation problem, cannot exec %s";
  1612. --- 3473,3477 ----
  1613.     if (errno < sys_nerr)
  1614.       s = concat ("installation problem, cannot exec %s: ",
  1615. !         strerror (errno), "");
  1616.     else
  1617.       s = "installation problem, cannot exec %s";
  1618. diff -2rcN gcc-2.2.2/genconfig.c my-gcc-2.2.2/genconfig.c
  1619. *** gcc-2.2.2/genconfig.c    Sat May 23 18:15:06 1992
  1620. --- my-gcc-2.2.2/genconfig.c    Fri Jul 17 22:38:53 1992
  1621. ***************
  1622. *** 278,283 ****
  1623. --- 278,291 ----
  1624.   from the machine description file `md'.  */\n\n");
  1625.   
  1626. + #ifdef amigados
  1627. +   /* this constant probably better be 14 in general, or a cross compiling
  1628. +      host might choke on some amigados header files... */
  1629. +   /* Allow at least 14 operands for the sake of asm constructs.  */
  1630. +   max_recog_operands = 14;
  1631. + #else
  1632.     /* Allow at least 10 operands for the sake of asm constructs.  */
  1633.     max_recog_operands = 9;  /* We will add 1 later.  */
  1634. + #endif
  1635.     max_dup_operands = 1;
  1636.   
  1637. diff -2rcN gcc-2.2.2/gstddef.h my-gcc-2.2.2/gstddef.h
  1638. *** gcc-2.2.2/gstddef.h    Thu Jun 11 19:08:00 1992
  1639. --- my-gcc-2.2.2/gstddef.h    Sat Jul 18 01:18:17 1992
  1640. ***************
  1641. *** 2,5 ****
  1642. --- 2,19 ----
  1643.   #ifndef _STDDEF_H_
  1644.   
  1645. + #ifdef amigados
  1646. + /* GNU libc has special support in this file, 4.3bsd-net2 libc deserves that
  1647. +    just as well. The system headers are ANSI compliant, the used compiler IS
  1648. +    gcc, so it's really ok to use the system header, no reason to hassle
  1649. +    with a jungle of ifdefs. Besides, amigados is only defined if compiling
  1650. +    with host=amigados, it doesn't apply if compiling with target=amigados
  1651. +    on a different host with possibly different system headers. Same thing
  1652. +    would apply to gstdarg.h and gvarargs.h, but those headers are more
  1653. +    easily fixable than this one and I'm sick of writing the same comment
  1654. +    there as well. MW */
  1655. + #include <stddef.h>
  1656. + #else /* not amigados */
  1657.   /* Any one of these symbols __need_* means that GNU libc
  1658.      wants us just to define one data type.  So don't define
  1659. ***************
  1660. *** 146,149 ****
  1661. --- 160,165 ----
  1662.   
  1663.   #endif /* _STDDEF_H was defined this time */
  1664. + #endif /* not amigados */
  1665.   #endif /* _STDDEF_H_ was not defined before */
  1666.   #endif /* _STDDEF_H was not defined before */
  1667. diff -2rcN gcc-2.2.2/gvarargs.h my-gcc-2.2.2/gvarargs.h
  1668. *** gcc-2.2.2/gvarargs.h    Tue May  5 17:22:07 1992
  1669. --- my-gcc-2.2.2/gvarargs.h    Fri Jul 17 23:15:00 1992
  1670. ***************
  1671. *** 68,72 ****
  1672.   /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.  */
  1673.   /* But in 4.3bsd-net2, _VA_LIST_ has another meaning.  So ignore it.  */
  1674. ! #if !defined (_VA_LIST_) || defined (_ANSI_H)
  1675.   /* The macro _VA_LIST is used in SCO Unix 3.2.  */
  1676.   #ifndef _VA_LIST
  1677. --- 68,72 ----
  1678.   /* The macro _VA_LIST_ is the same thing used by this file in Ultrix.  */
  1679.   /* But in 4.3bsd-net2, _VA_LIST_ has another meaning.  So ignore it.  */
  1680. ! #if !defined (_VA_LIST_) || defined (_ANSI_H) || defined (_ANSI_H_)
  1681.   /* The macro _VA_LIST is used in SCO Unix 3.2.  */
  1682.   #ifndef _VA_LIST
  1683. ***************
  1684. *** 79,83 ****
  1685.   typedef char * __va___list;
  1686.   #endif /* _VA_LIST */
  1687. ! #endif /* !defined (_VA_LIST_) || defined (_ANSI_H) */
  1688.   
  1689.   /*  In 4.3bsd-net2, it is said we must #undef this.
  1690. --- 79,83 ----
  1691.   typedef char * __va___list;
  1692.   #endif /* _VA_LIST */
  1693. ! #endif /* !defined (_VA_LIST_) || defined (_ANSI_H) || defined (_ANSI_H_) */
  1694.   
  1695.   /*  In 4.3bsd-net2, it is said we must #undef this.
  1696. ***************
  1697. *** 84,88 ****
  1698.       I hope this successfully identifies that system.
  1699.       I don't know why this works--rms.  */
  1700. ! #ifdef _ANSI_H
  1701.   #undef _VA_LIST_
  1702.   #endif
  1703. --- 84,88 ----
  1704.       I hope this successfully identifies that system.
  1705.       I don't know why this works--rms.  */
  1706. ! #if defined(_ANSI_H) || defined (_ANSI_H_)
  1707.   #undef _VA_LIST_
  1708.   #endif
  1709. diff -2rcN gcc-2.2.2/machmode.h my-gcc-2.2.2/machmode.h
  1710. *** gcc-2.2.2/machmode.h    Tue Mar 10 22:11:09 1992
  1711. --- my-gcc-2.2.2/machmode.h    Fri Jul 17 22:38:54 1992
  1712. ***************
  1713. *** 56,60 ****
  1714.   /* Get the name of mode MODE as a string.  */
  1715.   
  1716. ! extern char *mode_name[];
  1717.   #define GET_MODE_NAME(MODE)        (mode_name[(int)(MODE)])
  1718.   
  1719. --- 56,60 ----
  1720.   /* Get the name of mode MODE as a string.  */
  1721.   
  1722. ! extern char * const mode_name[];
  1723.   #define GET_MODE_NAME(MODE)        (mode_name[(int)(MODE)])
  1724.   
  1725. ***************
  1726. *** 65,69 ****
  1727.      (integer, floating, complex, etc.)  */
  1728.   
  1729. ! extern enum mode_class mode_class[];
  1730.   #define GET_MODE_CLASS(MODE)        (mode_class[(int)(MODE)])
  1731.   
  1732. --- 65,69 ----
  1733.      (integer, floating, complex, etc.)  */
  1734.   
  1735. ! extern const enum mode_class mode_class[];
  1736.   #define GET_MODE_CLASS(MODE)        (mode_class[(int)(MODE)])
  1737.   
  1738. ***************
  1739. *** 70,74 ****
  1740.   /* Get the size in bytes of an object of mode MODE.  */
  1741.   
  1742. ! extern int mode_size[];
  1743.   #define GET_MODE_SIZE(MODE)        (mode_size[(int)(MODE)])
  1744.   
  1745. --- 70,74 ----
  1746.   /* Get the size in bytes of an object of mode MODE.  */
  1747.   
  1748. ! extern const int mode_size[];
  1749.   #define GET_MODE_SIZE(MODE)        (mode_size[(int)(MODE)])
  1750.   
  1751. ***************
  1752. *** 75,79 ****
  1753.   /* Get the size in bytes of the basic parts of an object of mode MODE.  */
  1754.   
  1755. ! extern int mode_unit_size[];
  1756.   #define GET_MODE_UNIT_SIZE(MODE)    (mode_unit_size[(int)(MODE)])
  1757.   
  1758. --- 75,79 ----
  1759.   /* Get the size in bytes of the basic parts of an object of mode MODE.  */
  1760.   
  1761. ! extern const int mode_unit_size[];
  1762.   #define GET_MODE_UNIT_SIZE(MODE)    (mode_unit_size[(int)(MODE)])
  1763.   
  1764. ***************
  1765. *** 96,100 ****
  1766.   /* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI).  */
  1767.   
  1768. ! extern enum machine_mode mode_wider_mode[];
  1769.   #define GET_MODE_WIDER_MODE(MODE)    (mode_wider_mode[(int)(MODE)])
  1770.   
  1771. --- 96,100 ----
  1772.   /* Get the next wider natural mode (eg, QI -> HI -> SI -> DI -> TI).  */
  1773.   
  1774. ! extern const enum machine_mode mode_wider_mode[];
  1775.   #define GET_MODE_WIDER_MODE(MODE)    (mode_wider_mode[(int)(MODE)])
  1776.   
  1777. diff -2rcN gcc-2.2.2/print-tree.c my-gcc-2.2.2/print-tree.c
  1778. *** gcc-2.2.2/print-tree.c    Mon Apr 27 16:54:16 1992
  1779. --- my-gcc-2.2.2/print-tree.c    Fri Jul 17 22:38:56 1992
  1780. ***************
  1781. *** 25,29 ****
  1782.   extern char **tree_code_name;
  1783.   
  1784. ! extern char *mode_name[];
  1785.   
  1786.   void print_node ();
  1787. --- 25,29 ----
  1788.   extern char **tree_code_name;
  1789.   
  1790. ! extern char *const mode_name[];
  1791.   
  1792.   void print_node ();
  1793. diff -2rcN gcc-2.2.2/protoize.c my-gcc-2.2.2/protoize.c
  1794. *** gcc-2.2.2/protoize.c    Sun Jun 14 21:11:55 1992
  1795. --- my-gcc-2.2.2/protoize.c    Fri Jul 17 22:39:01 1992
  1796. ***************
  1797. *** 787,792 ****
  1798. --- 787,797 ----
  1799.     struct default_include *p;
  1800.   
  1801. + #ifdef FILE_NAME_ABSOLUTE_P
  1802. +   if (! FILE_NAME_ABSOLUTE_P (path))
  1803. +     abort ();
  1804. + #else
  1805.     if (path[0] != '/')
  1806.       abort ();        /* Must be an absolutized filename.  */
  1807. + #endif
  1808.   
  1809.     for (p = include_defaults; p->fname; p++)
  1810. ***************
  1811. *** 1215,1219 ****
  1812. --- 1220,1228 ----
  1813.       const char *src_p;
  1814.   
  1815. + #ifdef FILE_NAME_ABSOLUTE_P
  1816. +     if (! FILE_NAME_ABSOLUTE_P (rel_filename))
  1817. + #else
  1818.       if (rel_filename[0] != '/')
  1819. + #endif
  1820.         {
  1821.           src_p = cwd2;
  1822. ***************
  1823. *** 1478,1481 ****
  1824. --- 1487,1509 ----
  1825.   }
  1826.   
  1827. + /* Use this macro to advance a char * over the filename part in a line
  1828. +    read from an aux-info file. */
  1829. + #ifndef amigados
  1830. + /* Version for file systems where the colon has no special meaning */
  1831. + #define ADVANCE_PAST_FILENAME(CP) \
  1832. +   while (* (CP) != ':') (CP)++
  1833. + #else
  1834. + /* Have to heuristically decide whether the colon is part of the filename
  1835. +    or whether it serves to delimit the filename from the line number. If
  1836. +    it's the latter case, then the character following the colon *must*
  1837. +    be a digit. Note that this heuristic fails if the filename starts
  1838. +    with a digit. */
  1839. + #define ADVANCE_PAST_FILENAME(CP) \
  1840. +     while ((CP)[0] != ':' || !isdigit ((CP)[1])) \
  1841. +       (CP)++;
  1842. + #endif
  1843.   /* Given a line from  an aux info file, and a time at which the aux info
  1844.      file it came from was created, check to see if the item described in
  1845. ***************
  1846. *** 1499,1504 ****
  1847.       const char *filename_start = p = l + 3;
  1848.   
  1849. !     while (*p != ':')
  1850. !       p++;
  1851.       filename = (char *) alloca ((size_t) (p - filename_start) + 1);
  1852.       strncpy (filename, filename_start, (size_t) (p - filename_start));
  1853. --- 1527,1531 ----
  1854.       const char *filename_start = p = l + 3;
  1855.   
  1856. !     ADVANCE_PAST_FILENAME (p);
  1857.       filename = (char *) alloca ((size_t) (p - filename_start) + 1);
  1858.       strncpy (filename, filename_start, (size_t) (p - filename_start));
  1859. ***************
  1860. *** 1557,1562 ****
  1861.       char *filename;
  1862.   
  1863. !     while (*p != ':')
  1864. !       p++;
  1865.       filename = (char *) alloca ((size_t) (p - filename_start) + 1);
  1866.       strncpy (filename, filename_start, (size_t) (p - filename_start));
  1867. --- 1584,1588 ----
  1868.       char *filename;
  1869.   
  1870. !     ADVANCE_PAST_FILENAME (p);
  1871.       filename = (char *) alloca ((size_t) (p - filename_start) + 1);
  1872.       strncpy (filename, filename_start, (size_t) (p - filename_start));
  1873. ***************
  1874. *** 2227,2231 ****
  1875.       char *p = aux_info_base;
  1876.   
  1877. !     while (*p != ':')
  1878.         p++;
  1879.       p++;
  1880. --- 2253,2259 ----
  1881.       char *p = aux_info_base;
  1882.   
  1883. !     /* have to make sure at least one space is following the colon to make
  1884. !        sure the colon is not part of the filename */
  1885. !     while (*p != ':' && p[1] != ' ')
  1886.         p++;
  1887.       p++;
  1888. ***************
  1889. *** 2241,2245 ****
  1890. --- 2269,2277 ----
  1891.       aux_info_second_line = p;
  1892.       aux_info_relocated_name = 0;
  1893. + #ifdef FILE_NAME_ABSOLUTE_P
  1894. +     if (! FILE_NAME_ABSOLUTE_P (invocation_filename))
  1895. + #else
  1896.       if (invocation_filename[0] != '/')
  1897. + #endif
  1898.         {
  1899.       /* INVOCATION_FILENAME is relative;
  1900. ***************
  1901. *** 2329,2333 ****
  1902.   
  1903.   /* Check an individual filename for a .c suffix.  If the filename has this
  1904. !    suffix, rename the file such that its suffix is changed to .C.  This
  1905.      function implements the -C option.  */
  1906.   
  1907. --- 2361,2365 ----
  1908.   
  1909.   /* Check an individual filename for a .c suffix.  If the filename has this
  1910. !    suffix, rename the file such that its suffix is changed to .cc.  This
  1911.      function implements the -C option.  */
  1912.   
  1913. ***************
  1914. *** 2338,2342 ****
  1915.     const char *filename = hp->symbol;
  1916.     int last_char_index = strlen (filename) - 1;
  1917. !   char *const new_filename = (char *) alloca (strlen (filename) + 1);
  1918.   
  1919.     /* Note that we don't care here if the given file was converted or not.  It
  1920. --- 2370,2374 ----
  1921.     const char *filename = hp->symbol;
  1922.     int last_char_index = strlen (filename) - 1;
  1923. !   char *const new_filename = (char *) alloca (strlen (filename) + 2);
  1924.   
  1925.     /* Note that we don't care here if the given file was converted or not.  It
  1926. ***************
  1927. *** 2350,2355 ****
  1928.   
  1929.     strcpy (new_filename, filename);
  1930. !   new_filename[last_char_index] = 'C';
  1931.   
  1932.     if (my_link (filename, new_filename) == -1)
  1933.       {
  1934. --- 2382,2404 ----
  1935.   
  1936.     strcpy (new_filename, filename);
  1937. !   strcat (new_filename + last_char_index, "cc");
  1938. !   /* use rename(2) if available !! Update config files to include HAVE_rename
  1939. !      if the used OS provides it. Advantages are: it's atomic, it's one
  1940. !      system call compared to two. */
  1941. ! #ifdef HAVE_rename
  1942. !   /* if the mentioned systems (POSIX 1003.1-1988) have rename(2), this has
  1943. !      to be changed to `my_rename' as well. */
  1944.   
  1945. +   if (rename (filename, new_filename) == -1)
  1946. +     {
  1947. +       fprintf (stderr, "%s: warning: can't rename file `%s' to `%s': %s\n",
  1948. +            pname, shortpath (NULL, filename),
  1949. +            shortpath (NULL, new_filename), sys_errlist[errno]);
  1950. +       errors++;
  1951. +       return;
  1952. +     }
  1953. + #else
  1954.     if (my_link (filename, new_filename) == -1)
  1955.       {
  1956. ***************
  1957. *** 2368,2371 ****
  1958. --- 2417,2421 ----
  1959.         return;
  1960.       }
  1961. + #endif
  1962.   }
  1963.   
  1964. diff -2rcN gcc-2.2.2/rtl.c my-gcc-2.2.2/rtl.c
  1965. *** gcc-2.2.2/rtl.c    Wed May 13 22:27:52 1992
  1966. --- my-gcc-2.2.2/rtl.c    Fri Jul 17 22:39:03 1992
  1967. ***************
  1968. *** 50,54 ****
  1969.   #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   NAME ,
  1970.   
  1971. ! char *rtx_name[] = {
  1972.   #include "rtl.def"        /* rtl expressions are documented here */
  1973.   };
  1974. --- 50,54 ----
  1975.   #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   NAME ,
  1976.   
  1977. ! char * const rtx_name[] = {
  1978.   #include "rtl.def"        /* rtl expressions are documented here */
  1979.   };
  1980. ***************
  1981. *** 61,65 ****
  1982.   #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  NAME,
  1983.   
  1984. ! char *mode_name[(int) MAX_MACHINE_MODE] = {
  1985.   #include "machmode.def"
  1986.   
  1987. --- 61,65 ----
  1988.   #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  NAME,
  1989.   
  1990. ! char * const mode_name[(int) MAX_MACHINE_MODE] = {
  1991.   #include "machmode.def"
  1992.   
  1993. ***************
  1994. *** 77,81 ****
  1995.   #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  CLASS,
  1996.   
  1997. ! enum mode_class mode_class[(int) MAX_MACHINE_MODE] = {
  1998.   #include "machmode.def"
  1999.   };
  2000. --- 77,81 ----
  2001.   #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  CLASS,
  2002.   
  2003. ! const enum mode_class mode_class[(int) MAX_MACHINE_MODE] = {
  2004.   #include "machmode.def"
  2005.   };
  2006. ***************
  2007. *** 88,92 ****
  2008.   #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  SIZE,
  2009.   
  2010. ! int mode_size[(int) MAX_MACHINE_MODE] = {
  2011.   #include "machmode.def"
  2012.   };
  2013. --- 88,92 ----
  2014.   #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  SIZE,
  2015.   
  2016. ! const int mode_size[(int) MAX_MACHINE_MODE] = {
  2017.   #include "machmode.def"
  2018.   };
  2019. ***************
  2020. *** 99,103 ****
  2021.   #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  UNIT,
  2022.   
  2023. ! int mode_unit_size[(int) MAX_MACHINE_MODE] = {
  2024.   #include "machmode.def"        /* machine modes are documented here */
  2025.   };
  2026. --- 99,103 ----
  2027.   #define DEF_MACHMODE(SYM, NAME, CLASS, SIZE, UNIT, WIDER)  UNIT,
  2028.   
  2029. ! const int mode_unit_size[(int) MAX_MACHINE_MODE] = {
  2030.   #include "machmode.def"        /* machine modes are documented here */
  2031.   };
  2032. ***************
  2033. *** 112,116 ****
  2034.     (enum machine_mode) WIDER,
  2035.   
  2036. ! enum machine_mode mode_wider_mode[(int) MAX_MACHINE_MODE] = {
  2037.   #include "machmode.def"        /* machine modes are documented here */
  2038.   };
  2039. --- 112,116 ----
  2040.     (enum machine_mode) WIDER,
  2041.   
  2042. ! const enum machine_mode mode_wider_mode[(int) MAX_MACHINE_MODE] = {
  2043.   #include "machmode.def"        /* machine modes are documented here */
  2044.   };
  2045. ***************
  2046. *** 131,135 ****
  2047.      each character describes one operand.  */
  2048.   
  2049. ! char *rtx_format[] = {
  2050.     /* "*" undefined.
  2051.            can cause a warning message
  2052. --- 131,135 ----
  2053.      each character describes one operand.  */
  2054.   
  2055. ! char *const rtx_format[] = {
  2056.     /* "*" undefined.
  2057.            can cause a warning message
  2058. ***************
  2059. *** 160,164 ****
  2060.      that rtx code.  See rtl.def for documentation on the defined classes.  */
  2061.   
  2062. ! char rtx_class[] = {
  2063.   #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   CLASS, 
  2064.   #include "rtl.def"        /* rtl expressions are defined here */
  2065. --- 160,164 ----
  2066.      that rtx code.  See rtl.def for documentation on the defined classes.  */
  2067.   
  2068. ! const char rtx_class[] = {
  2069.   #define DEF_RTL_EXPR(ENUM, NAME, FORMAT, CLASS)   CLASS, 
  2070.   #include "rtl.def"        /* rtl expressions are defined here */
  2071. ***************
  2072. *** 168,172 ****
  2073.   /* Names for kinds of NOTEs and REG_NOTEs.  */
  2074.   
  2075. ! char *note_insn_name[] = { "NOTE_INSN_FUNCTION_BEG", "NOTE_INSN_DELETED",
  2076.                  "NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END",
  2077.                  "NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END",
  2078. --- 168,173 ----
  2079.   /* Names for kinds of NOTEs and REG_NOTEs.  */
  2080.   
  2081. ! char * const note_insn_name[] = 
  2082. !              { "NOTE_INSN_FUNCTION_BEG", "NOTE_INSN_DELETED",
  2083.                  "NOTE_INSN_BLOCK_BEG", "NOTE_INSN_BLOCK_END",
  2084.                  "NOTE_INSN_LOOP_BEG", "NOTE_INSN_LOOP_END",
  2085. ***************
  2086. *** 174,178 ****
  2087.                  "NOTE_INSN_LOOP_CONT", "NOTE_INSN_LOOP_VTOP" };
  2088.   
  2089. ! char *reg_note_name[] = { "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_WAS_0",
  2090.                 "REG_EQUAL", "REG_RETVAL", "REG_LIBCALL",
  2091.                 "REG_NONNEG", "REG_NO_CONFLICT", "REG_UNUSED",
  2092. --- 175,180 ----
  2093.                  "NOTE_INSN_LOOP_CONT", "NOTE_INSN_LOOP_VTOP" };
  2094.   
  2095. ! char * const reg_note_name[] = 
  2096. !             { "", "REG_DEAD", "REG_INC", "REG_EQUIV", "REG_WAS_0",
  2097.                 "REG_EQUAL", "REG_RETVAL", "REG_LIBCALL",
  2098.                 "REG_NONNEG", "REG_NO_CONFLICT", "REG_UNUSED",
  2099. diff -2rcN gcc-2.2.2/rtl.h my-gcc-2.2.2/rtl.h
  2100. *** gcc-2.2.2/rtl.h    Thu May  7 06:37:55 1992
  2101. --- my-gcc-2.2.2/rtl.h    Fri Jul 17 22:39:05 1992
  2102. ***************
  2103. *** 43,53 ****
  2104.   #define GET_RTX_LENGTH(CODE)        (rtx_length[(int)(CODE)])
  2105.   
  2106. ! extern char *rtx_name[];
  2107.   #define GET_RTX_NAME(CODE)        (rtx_name[(int)(CODE)])
  2108.   
  2109. ! extern char *rtx_format[];
  2110.   #define GET_RTX_FORMAT(CODE)        (rtx_format[(int)(CODE)])
  2111.   
  2112. ! extern char rtx_class[];
  2113.   #define GET_RTX_CLASS(CODE)        (rtx_class[(int)(CODE)])
  2114.   
  2115. --- 43,53 ----
  2116.   #define GET_RTX_LENGTH(CODE)        (rtx_length[(int)(CODE)])
  2117.   
  2118. ! extern char * const rtx_name[];
  2119.   #define GET_RTX_NAME(CODE)        (rtx_name[(int)(CODE)])
  2120.   
  2121. ! extern char * const rtx_format[];
  2122.   #define GET_RTX_FORMAT(CODE)        (rtx_format[(int)(CODE)])
  2123.   
  2124. ! extern const char rtx_class[];
  2125.   #define GET_RTX_CLASS(CODE)        (rtx_class[(int)(CODE)])
  2126.   
  2127. ***************
  2128. *** 292,296 ****
  2129.   /* Names for REG_NOTE's in EXPR_LIST insn's.  */
  2130.   
  2131. ! extern char *reg_note_name[];
  2132.   #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int)(MODE)])
  2133.   
  2134. --- 292,296 ----
  2135.   /* Names for REG_NOTE's in EXPR_LIST insn's.  */
  2136.   
  2137. ! extern char *const reg_note_name[];
  2138.   #define GET_REG_NOTE_NAME(MODE) (reg_note_name[(int)(MODE)])
  2139.   
  2140. ***************
  2141. *** 347,351 ****
  2142.   /* Names for NOTE insn's other than line numbers.  */
  2143.   
  2144. ! extern char *note_insn_name[];
  2145.   #define GET_NOTE_INSN_NAME(NOTE_CODE) (note_insn_name[-(NOTE_CODE)])
  2146.   
  2147. --- 347,351 ----
  2148.   /* Names for NOTE insn's other than line numbers.  */
  2149.   
  2150. ! extern char *const note_insn_name[];
  2151.   #define GET_NOTE_INSN_NAME(NOTE_CODE) (note_insn_name[-(NOTE_CODE)])
  2152.   
  2153. diff -2rcN gcc-2.2.2/toplev.c my-gcc-2.2.2/toplev.c
  2154. *** gcc-2.2.2/toplev.c    Thu May 28 05:36:37 1992
  2155. --- my-gcc-2.2.2/toplev.c    Fri Jul 17 22:39:10 1992
  2156. ***************
  2157. *** 471,474 ****
  2158. --- 471,475 ----
  2159.     {"writable-strings", &flag_writable_strings, 1},
  2160.     {"peephole", &flag_no_peephole, 0},
  2161. +   {"large-baserel", &flag_pic, 4},
  2162.     {"force-mem", &flag_force_mem, 1},
  2163.     {"force-addr", &flag_force_addr, 1},
  2164. ***************
  2165. *** 488,491 ****
  2166. --- 489,493 ----
  2167.     {"pic", &flag_pic, 1},
  2168.     {"PIC", &flag_pic, 2},
  2169. +   {"baserel", &flag_pic, 3},
  2170.     {"fast-math", &flag_fast_math, 1},
  2171.     {"common", &flag_no_common, 0},
  2172. ***************
  2173. *** 1290,1293 ****
  2174. --- 1292,1298 ----
  2175.        char *input_name;
  2176.   {
  2177. + #ifdef FILE_NAME_NONDIRECTORY
  2178. +   char *na = FILE_NAME_NONDIRECTORY (input_name);
  2179. + #else
  2180.     int len = strlen (input_name);
  2181.     char *na = input_name + len;
  2182. ***************
  2183. *** 1300,1303 ****
  2184. --- 1305,1309 ----
  2185.         na--;
  2186.       }
  2187. + #endif
  2188.   
  2189.   #ifdef ASM_OUTPUT_MAIN_SOURCE_FILENAME
  2190. ***************
  2191. *** 3057,3060 ****
  2192. --- 3063,3067 ----
  2193.   #ifndef OS2
  2194.   #ifndef VMS
  2195. + #ifndef amigados
  2196.     if (flag_print_mem)
  2197.       {
  2198. ***************
  2199. *** 3071,3074 ****
  2200. --- 3078,3082 ----
  2201.   #endif /* not USG */
  2202.       }
  2203. + #endif /* not amigados */
  2204.   #endif /* not VMS */
  2205.   #endif /* not OS2 */
  2206. diff -2rcN gcc-2.2.2/tree.c my-gcc-2.2.2/tree.c
  2207. *** gcc-2.2.2/tree.c    Tue May 12 02:51:10 1992
  2208. --- my-gcc-2.2.2/tree.c    Fri Jul 17 22:39:13 1992
  2209. ***************
  2210. *** 218,222 ****
  2211.   static int do_identifier_warnings;
  2212.   
  2213. ! extern char *mode_name[];
  2214.   
  2215.   void gcc_obstack_init ();
  2216. --- 218,222 ----
  2217.   static int do_identifier_warnings;
  2218.   
  2219. ! extern char *const mode_name[];
  2220.   
  2221.   void gcc_obstack_init ();
  2222.